Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Commit

Permalink
EZP-26145: Unable to undo in the RichText editor (#664)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpobel authored Aug 29, 2016
1 parent 2b84f14 commit 7963cbd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Resources/public/js/alloyeditor/plugins/yui3.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ YUI.add('ez-alloyeditor-plugin-yui3', function (Y) {
}

function cleanUpIds(editor) {
editor.undoManager.lock();
Array.prototype.forEach.call(
editor.element.$.querySelectorAll('[id]'),
function (element) {
element.removeAttribute('id');
}
);
editor.undoManager.unlock();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,21 @@ YUI.add('ez-alloyeditor-plugin-yui3-tests', function (Y) {
"The id should have been removed"
);
},

"Should lock and unlock the undo manager": function () {
var nativeEditor = this.editor.get('nativeEditor');

nativeEditor.undoManager = new Mock(nativeEditor.undoManager);
Mock.expect(nativeEditor.undoManager, {
method: 'lock',
});
Mock.expect(nativeEditor.undoManager, {
method: 'unlock',
});
nativeEditor.execCommand('bold');

Mock.verify(nativeEditor.undoManager);
},
});

Y.Test.Runner.setName("eZ AlloyEditor yui3 plugin tests");
Expand Down

0 comments on commit 7963cbd

Please # to comment.