diff options
author | Jitesh Kumar Jha | 2016-06-10 11:11:07 +0530 |
---|---|---|
committer | GitHub | 2016-06-10 11:11:07 +0530 |
commit | 97538b089128001ae1d9deb0d437b0d0b67f0c35 (patch) | |
tree | bd559e04a0eff12f75d69f2bd6f077d66bd6c5ff | |
parent | 679ad3cd87015ad8332955821bcd07c381440691 (diff) | |
download | xcos-on-web-97538b089128001ae1d9deb0d437b0d0b67f0c35.tar.gz xcos-on-web-97538b089128001ae1d9deb0d437b0d0b67f0c35.tar.bz2 xcos-on-web-97538b089128001ae1d9deb0d437b0d0b67f0c35.zip |
Update mxUndomanager comments
-rw-r--r-- | index.html | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -183,15 +183,29 @@ else if(source.value = "CommandPort") { alert("Command port must be connected to control port"); } + + /* + Remove last mxEvent from the undoManager history stack, + Store all the remaining undo mxEvents into a temporary array, + clears the history, and readds the mxEvents into the undoManager history stack. + */ editor.execute('undo'); + + // Remove the last element from the history array. undoManager.history.splice(-1,1); + + // storage[] -> temporary array var storage = []; for(i in undoManager.history) { if(undoManager.history[i] != null) { storage.push(undoManager.history[i]) } } + + // Clear the undoManager history, and reset the undoManager pointer to avoid any undo of null events. undoManager.clear(); + + // Move the remaning mxEvents back into the undoManager history stack. for(i in storage) { if(storage[i] != null) { undoManager.undoableEditHappened(storage[i]); |