Commit 67795ddf authored by Alexander.Trofimov's avatar Alexander.Trofimov

fix bug 33004

loop next/prev sheets on hotkeys Alt+PageUp/Alt+PageDown
parent 3dcac934
......@@ -1425,23 +1425,26 @@
};
WorkbookView.prototype._onShowNextPrevWorksheet = function(direction) {
// Проверка на неправильное направление
if (0 === direction) {
return false;
}
// Колличество листов
var countWorksheets = this.model.getWorksheetCount();
// Покажем следующий лист или предыдущий (если больше нет)
var i, ws;
for (i = this.wsActive + direction; (0 > direction) ? (i >= 0) : (i < countWorksheets); i += direction) {
var i = this.wsActive + direction, ws;
while (i !== this.wsActive) {
if (0 > i) {
i = countWorksheets - 1;
} else if (i >= countWorksheets) {
i = 0;
}
ws = this.model.getWorksheet(i);
if (false === ws.getHidden()) {
if (!ws.getHidden()) {
this.showWorksheet(i);
this.handlers.trigger("asc_onActiveSheetChanged", i);
return true;
}
}
i += direction;
}
return false;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment