ライブラリ更新

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@5714 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2010-01-04 07:37:58 +00:00
parent dcc364a4f1
commit e8ad4cb544

View File

@ -155,10 +155,11 @@
this._doingUndo = true;
var processed = false;
while (processed === false)
{
let error;
let data = history.entries[history.index--];
var error;
do {
let data = history.entries[history.index];
history.index = Math.max(0, history.index-1);
if (!data) continue;
let f = this._getAvailableFunction(data.onUndo, data.onundo, data.undo);
let done = false;
try {
@ -175,9 +176,12 @@
}
this._dispatchEvent('UIOperationGlobalHistoryUndo', options, data, done);
}
while (processed === false && history.index > 0)
this._doingUndo = false;
if (error) throw error;
if (error)
throw error;
return true;
},
@ -185,14 +189,17 @@
{
var options = this._getOptionsFromArguments(arguments);
var history = options.history;
if (history.index > history.entries.length-1)
var max = history.entries.length;
if (history.index > max-1)
return false;
this._doingUndo = true;
var processed = false;
while (processed === false)
{
let error;
var error;
do {
let data = history.entries[history.index];
history.index = Math.min(max-1, history.index+1);
if (!data) continue;
let f = this._getAvailableFunction(data.onRedo, data.onredo, data.redo);
let done = false;
try {
@ -209,9 +216,12 @@
}
this._dispatchEvent('UIOperationGlobalHistoryRedo', options, data, done);
}
while (processed === false && history.index < max-1)
this._doingUndo = false;
if (error) throw error;
if (error)
throw error;
return true;
},