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

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; {
try { let error;
if (f) { let data = history.entries[history.index--];
f.call(data); let f = this._getAvailableFunction(data.onUndo, data.onundo, data.undo);
done = true; 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; 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)
try { {
if (f) { let error;
f.call(data); let f = this._getAvailableFunction(data.onRedo, data.onredo, data.redo);
done = true; 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; this._doingUndo = false;
if (error) throw error; if (error) throw error;