Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ui/react/src/adapter/alloy-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
37 changes: 37 additions & 0 deletions src/ui/react/test/alloy-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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'
});
});
});
});
}());