From 5197d8421ff91b19d64f9ba40bdb8a794597f9dc Mon Sep 17 00:00:00 2001 From: piro Date: Mon, 4 Jan 2010 04:34:55 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BD=95=E3=82=82=E3=81=97=E3=81=AA=E3=81=84?= =?UTF-8?q?=E3=82=A8=E3=83=B3=E3=83=88=E3=83=AA=E3=82=92=E7=99=BB=E9=8C=B2?= =?UTF-8?q?=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@5695 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/res/operationHistory.js | 62 ++++++++++++-------- 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/content/treestyletab/res/operationHistory.js b/content/treestyletab/res/operationHistory.js index 19b11236..6030793b 100644 --- a/content/treestyletab/res/operationHistory.js +++ b/content/treestyletab/res/operationHistory.js @@ -97,22 +97,28 @@ if (history.index < 0) return false; - var error; - this._doingUndo = true; - var data = history.entries[history.index--]; - var f = this._getAvailableFunction(data.onUndo, data.onundo, data.undo); - var done = false; - try { - if (f) { - f.call(data); - done = true; + var processed = false; + while (processed === false) + { + let error; + let data = history.entries[history.index--]; + let f = this._getAvailableFunction(data.onUndo, data.onundo, data.undo); + let done = false; + try { + if (f) { + processed = f.call(data); + done = true; + } + else { + processed = true; + } } + catch(e) { + error = e; + } + this._dispatchEvent('UIOperationGlobalHistoryUndo', options, data, done); } - catch(e) { - error = e; - } - this._dispatchEvent('UIOperationGlobalHistoryUndo', options, data, done); this._doingUndo = false; if (error) throw error; @@ -126,21 +132,27 @@ if (history.index > history.entries.length-1) return false; - var error; - this._doingUndo = true; - var f = this._getAvailableFunction(data.onRedo, data.onredo, data.redo); - var done = false; - try { - if (f) { - f.call(data); - done = true; + var processed = false; + while (processed === false) + { + let error; + let f = this._getAvailableFunction(data.onRedo, data.onredo, data.redo); + let done = false; + try { + if (f) { + processed = f.call(data); + done = true; + } + else { + processed = true; + } } + catch(e) { + error = e; + } + this._dispatchEvent('UIOperationGlobalHistoryRedo', options, data, done); } - catch(e) { - error = e; - } - this._dispatchEvent('UIOperationGlobalHistoryRedo', options, data, done); this._doingUndo = false; if (error) throw error;