diff --git a/src/ui/react/src/adapter/alloy-editor.js b/src/ui/react/src/adapter/alloy-editor.js index fc30260414..da0188b695 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 8bf3d54211..7c64435dd1 100644 --- a/src/ui/react/test/alloy-editor.js +++ b/src/ui/react/test/alloy-editor.js @@ -12,6 +12,13 @@ document.body.removeChild(this.el); }; + var doTestIE = function() { + if (!CKEDITOR.env.ie) { + this.skip(); + } + return; + }; + var initEditor = function(done, config) { this.el = document.createElement('div'); this.el.setAttribute('id', 'editable'); @@ -315,5 +322,35 @@ assert.sameMembers(['foo2', 'bar2'], buttons); }); }); + + 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