Skip to content

Commit

Permalink
Fixed bug where hasUndo() would return wrong answer
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Apr 10, 2011
1 parent 6d9bd75 commit 100ea83
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Expand Up @@ -2,6 +2,7 @@ Version 3.4.3 (2011-??-??)
Fixed bug where table size inputs were to small for values with size units. Fixed bug where table size inputs were to small for values with size units.
Fixed bug where table cell/row size input values were not validated. Fixed bug where table cell/row size input values were not validated.
Fixed bug where menu item line-height would be set to wrong value by external styles. Fixed bug where menu item line-height would be set to wrong value by external styles.
Fixed bug where hasUndo() would return wrong answer.
Version 3.4.2 (2011-04-07) Version 3.4.2 (2011-04-07)
Added new 'paste_text_sticky_default' option to paste plugin, enables you to set the default state for paste as plain text. Added new 'paste_text_sticky_default' option to paste plugin, enables you to set the default state for paste as plain text.
Added new autoresize_bottom_margin option to autoresize plugin that enables you to add an extra margin at the bottom. Patch contributed by Andrew Ozz. Added new autoresize_bottom_margin option to autoresize plugin that enables you to add an extra margin at the bottom. Patch contributed by Andrew Ozz.
Expand Down
8 changes: 3 additions & 5 deletions jscripts/tiny_mce/classes/Editor.js
Expand Up @@ -3172,8 +3172,7 @@


if (!t.undoManager.typing) { if (!t.undoManager.typing) {
t.undoManager.beforeChange(); t.undoManager.beforeChange();
t.undoManager.typing = true; addUndo();
t.undoManager.add();
} }


// Select next word when ctrl key is used in combo with delete // Select next word when ctrl key is used in combo with delete
Expand Down Expand Up @@ -3222,8 +3221,7 @@
// If key isn't shift,ctrl,alt,capslock,metakey // If key isn't shift,ctrl,alt,capslock,metakey
if ((keyCode < 16 || keyCode > 20) && keyCode != 224 && keyCode != 91 && !t.undoManager.typing) { if ((keyCode < 16 || keyCode > 20) && keyCode != 224 && keyCode != 91 && !t.undoManager.typing) {
t.undoManager.beforeChange(); t.undoManager.beforeChange();
t.undoManager.add(); addUndo();
t.undoManager.typing = true;
} }
}); });


Expand All @@ -3232,7 +3230,7 @@
addUndo(); addUndo();
}); });
} }

// Bug fix for FireFox keeping styles from end of selection instead of start. // Bug fix for FireFox keeping styles from end of selection instead of start.
if (tinymce.isGecko) { if (tinymce.isGecko) {
function getAttributeApplyFunction() { function getAttributeApplyFunction() {
Expand Down
6 changes: 3 additions & 3 deletions jscripts/tiny_mce/themes/advanced/editor_template_src.js
Expand Up @@ -936,10 +936,10 @@
}, },


_updateUndoStatus : function(ed) { _updateUndoStatus : function(ed) {
var cm = ed.controlManager; var cm = ed.controlManager, um = ed.undoManager;


cm.setDisabled('undo', !ed.undoManager.hasUndo() && !ed.typing); cm.setDisabled('undo', !um.hasUndo() && !um.typing);
cm.setDisabled('redo', !ed.undoManager.hasRedo()); cm.setDisabled('redo', !um.hasRedo());
}, },


_nodeChanged : function(ed, cm, n, co, ob) { _nodeChanged : function(ed, cm, n, co, ob) {
Expand Down

0 comments on commit 100ea83

Please sign in to comment.