diff --git a/src/ui/react/src/adapter/alloy-editor.js b/src/ui/react/src/adapter/alloy-editor.js index 08865d690d..8c668c4520 100644 --- a/src/ui/react/src/adapter/alloy-editor.js +++ b/src/ui/react/src/adapter/alloy-editor.js @@ -43,13 +43,13 @@ editor.config.selectionKeystrokes = this.get('selectionKeystrokes'); + AlloyEditor.Lang.mix(editor.config, config); + if (CKEDITOR.env.ie) { editor.config.extraPlugins = editor.config.extraPlugins.replace('ae_dragresize', 'ae_dragresize_ie'); editor.config.removePlugins = editor.config.removePlugins.replace('ae_dragresize', 'ae_dragresize_ie'); } - AlloyEditor.Lang.mix(editor.config, config); - editor.once('contentDom', function() { this._addReadOnlyLinkClickListener(editor); diff --git a/src/ui/react/test/alloy-editor.js b/src/ui/react/test/alloy-editor.js index 704c7df906..98f0f7b369 100644 --- a/src/ui/react/test/alloy-editor.js +++ b/src/ui/react/test/alloy-editor.js @@ -24,6 +24,13 @@ }); }; + var doTestIE = function() { + if (!CKEDITOR.env.ie) { + this.skip(); + } + return; + }; + describe('AlloyEditor', function() { this.timeout(35000); @@ -280,5 +287,35 @@ done(); }, 50); }); + + describe('in IE browsers', function () { + this.timeout(35000); + + beforeEach(function() { + doTestIE.call(this); + }); + + afterEach(function() { + cleanUpEditor.call(this); + }); + + it('should use the ae_dragresize_ie plugin instead of ae_dragresize by default', function(done) { + doTestIE.call(this); + + initEditor.call(this, function() { + assert.isTrue(this.alloyEditor.get('nativeEditor').config.extraPlugins.indexOf('ae_dragresize_ie') >= 0); + done(); + }.bind(this)); + }); + + it('should use the ae_dragresize_ie plugin even if the ae_dragresize is passed in the editor configuration', function(done) { + initEditor.call(this, function() { + assert.isTrue(this.alloyEditor.get('nativeEditor').config.extraPlugins.indexOf('ae_dragresize_ie') >= 0); + done(); + }.bind(this), { + extraPlugins: 'ae_dragresize' + }); + }); + }); }); }()); \ No newline at end of file