何もしないエントリを登録できるように

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@5695 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2010-01-04 04:34:55 +00:00
parent c8cdb18ccc
commit 5197d8421f

View File

@ -97,22 +97,28 @@
if (history.index < 0) if (history.index < 0)
return false; return false;
var error;
this._doingUndo = true; this._doingUndo = true;
var data = history.entries[history.index--]; var processed = false;
var f = this._getAvailableFunction(data.onUndo, data.onundo, data.undo); while (processed === false)
var done = false; {
let error;
let data = history.entries[history.index--];
let f = this._getAvailableFunction(data.onUndo, data.onundo, data.undo);
let done = false;
try { try {
if (f) { if (f) {
f.call(data); processed = f.call(data);
done = true; done = true;
} }
else {
processed = true;
}
} }
catch(e) { catch(e) {
error = e; error = e;
} }
this._dispatchEvent('UIOperationGlobalHistoryUndo', options, data, done); this._dispatchEvent('UIOperationGlobalHistoryUndo', options, data, done);
}
this._doingUndo = false; this._doingUndo = false;
if (error) throw error; if (error) throw error;
@ -126,21 +132,27 @@
if (history.index > history.entries.length-1) if (history.index > history.entries.length-1)
return false; return false;
var error;
this._doingUndo = true; this._doingUndo = true;
var f = this._getAvailableFunction(data.onRedo, data.onredo, data.redo); var processed = false;
var done = false; while (processed === false)
{
let error;
let f = this._getAvailableFunction(data.onRedo, data.onredo, data.redo);
let done = false;
try { try {
if (f) { if (f) {
f.call(data); processed = f.call(data);
done = true; done = true;
} }
else {
processed = true;
}
} }
catch(e) { catch(e) {
error = e; error = e;
} }
this._dispatchEvent('UIOperationGlobalHistoryRedo', options, data, done); this._dispatchEvent('UIOperationGlobalHistoryRedo', options, data, done);
}
this._doingUndo = false; this._doingUndo = false;
if (error) throw error; if (error) throw error;