Skip to content

Commit 585b0d2

Browse files
author
jamesprior
committed
using jquery fail-safe in custom ckeditor modules
1 parent e1009d5 commit 585b0d2

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

app/assets/javascripts/ckeditor/plugins/delete_content/plugin.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ CKEDITOR.plugins.add('delete_content', {
2828
],
2929

3030
onOk:function () {
31+
jQuery(function ($) {
3132
$.cms_editor.deleteContent();
33+
});
3234
}
3335
};
3436
});

app/assets/javascripts/ckeditor/plugins/edit_content/plugin.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@ CKEDITOR.plugins.add('edit_content', {
1111
editor.addCommand('editContent', {
1212
exec:function (editor) {
1313
var goto_edit = function(){
14+
jQuery(function ($) {
1415
window.parent.location = $.cms_editor.selectedConnector().data('edit-path');
16+
});
1517
};
1618
if (editor.checkDirty()) {
19+
jQuery(function ($) {
1720
$.cms_editor.saveChanges(editor, goto_edit);
21+
});
1822
} else {
1923
goto_edit.apply();
2024
}

app/assets/javascripts/ckeditor/plugins/move_content/plugin.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@ CKEDITOR.plugins.add('move_content', {
1313
});
1414
editor.addCommand('moveContentDown', {
1515
exec:function (editor) {
16+
jQuery(function ($) {
1617
$.cms_editor.moveContent(editor, 'move-down');
18+
});
1719
}
1820
});
1921
editor.addCommand('moveContentUp', {
2022
exec:function (editor) {
23+
jQuery(function ($) {
2124
$.cms_editor.moveContent(editor, 'move-up');
25+
});
2226
}
2327
});
2428
}

0 commit comments

Comments
 (0)