Skip to content

Commit 8fa50db

Browse files
committed
fix: ckeditor4 icon & focus
1 parent 09b1e10 commit 8fa50db

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

private/js/ckeditor4_plugins/cmsplugins/plugin.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import CmsDialog from "../../cms.dialog";
22

33
(function ($) {
4-
if (CKEDITOR && CKEDITOR.plugins && CKEDITOR.plugins.registered && CKEDITOR.plugins.registered.cmsplugins) {
4+
if (CKEDITOR && CKEDITOR.plugins && CKEDITOR.plugins.registered && CKEDITOR.plugins.registered.CMSPlugins) {
55
return;
66
}
77

@@ -109,7 +109,7 @@ import CmsDialog from "../../cms.dialog";
109109

110110
// this is called when creating the dropdown list
111111
onBlock: function (panel, block) {
112-
block.element.setHtml(editor.plugins.CMSPlugins.setupDropdown(editor));
112+
block.element.setHtml(that.setupDropdown(editor));
113113

114114
var anchors = $(block.element.$).find('.cke_panel_listItem a');
115115

@@ -137,7 +137,7 @@ import CmsDialog from "../../cms.dialog";
137137
});
138138

139139
// handle edit event on double click
140-
// if event is a jQuery event (touchend), than we mutate
140+
// if event is a jQuery event (touchend), then we mutate
141141
// event a bit so we make the payload similar to what ckeditor.event produces
142142
var handleEdit = function (event) {
143143
event.stop();
@@ -273,7 +273,7 @@ import CmsDialog from "../../cms.dialog";
273273
editor.addMenuGroup('cmspluginsGroup');
274274
editor.addMenuItem('cmspluginsItem', {
275275
label: settings.lang.CMSPlugins.editLabel,
276-
icon: settings.static_url + '/ckeditor_plugins/cmsplugins/icons/cmsplugins.svg',
276+
icon: settings.static_url + '/icons/cmsplugins.svg',
277277
command: 'cmspluginsEdit',
278278
group: 'cmspluginsGroup'
279279
});

private/js/cms.ckeditor4.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
/* global document, window, console */
99

1010

11-
import './ckeditor4_plugins/cmsdialog/plugin';
1211
import './ckeditor4_plugins/cmsplugins/plugin';
1312
import './ckeditor4_plugins/cmsresize/plugin';
1413
import './ckeditor4_plugins/cmswidget/plugin';
@@ -28,7 +27,7 @@ window.cms_editor_plugin = {
2827
skin: 'moono-lisa',
2928
toolbar_CMS: [
3029
['Undo', 'Redo'],
31-
['cmsplugins', 'cmswidget', '-', 'ShowBlocks'],
30+
['CMSPlugins', 'cmswidget', '-', 'ShowBlocks'],
3231
['Format', 'Styles'],
3332
['TextColor', 'BGColor', '-', 'PasteText', 'PasteFromWord'],
3433
['Scayt'],
@@ -69,7 +68,7 @@ window.cms_editor_plugin = {
6968

7069
// add extra plugins that we absolutely must have
7170
all_options.extraPlugins = all_options.extraPlugins +=
72-
',CMSPlugins,cmswidget,cmsdialog,cmsresize,widget';
71+
',CMSPlugins,cmswidget,cmsresize,widget';
7372

7473
if (typeof all_options.toolbar === 'string' && ('toolbar_' + all_options.toolbar) in all_options) {
7574
all_options.toolbar = all_options['toolbar_' + all_options.toolbar];
@@ -86,7 +85,7 @@ window.cms_editor_plugin = {
8685

8786
// add additional plugins (autoloads plugins.js)
8887
CKEDITOR.skin.addIcon('CMSPlugins', settings.static_url +
89-
'/ckeditor_plugins/cmsplugins/icons/cmsplugins.svg');
88+
'/icons/cmsplugins.svg');
9089
CKEDITOR.disableAutoInline = true
9190
};
9291
if (!(el.id in this._editors)) {

private/js/cms.editor.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,10 @@ class CMSEditor {
473473
return;
474474
}
475475
}
476-
if (this.CMS.settings.version < "4") {
476+
// Additional content for the page disrupts inline editing and needs to be removed
477+
delete this.CMS.API.Helpers.dataBridge.content;
478+
479+
if (this.CMS.settings.version.startsWith('3.')) {
477480
/* Reflect dirty flag in django CMS < 4 */
478481
try {
479482
/* For some reason, in v3 this fails if the structure board is not open */

0 commit comments

Comments
 (0)