5
rated 0 times
[
9]
[
4]
/ answers: 1 / hits: 16785
/ 11 Years ago, tue, october 29, 2013, 12:00:00
I'm quite new to the ACE editor and javascript in general however I have managed to achieve most of what I intended apart from the following:
I would like to enable or disable a 'save' button depending on whether there are outstanding modifications to the document and I have attempted to do this with 'change' event:
UndoManager.reset();
$('#save').addClass(disabled);
editor.on('change', function() {
if (UndoManager.hasUndo()) {
$('#save').removeClass(disabled);
}
else {
$('#save').addClass(disabled);
}
});
On loading a document the 'disabled' class is removed immediately.
Many thanks in advance if anyone can show me how it should be done.
More From » ace-editor