Commit 17b766b9 authored by Alexander.Trofimov's avatar Alexander.Trofimov

fix bug 33829

parent 4a51133b
...@@ -125,9 +125,6 @@ ...@@ -125,9 +125,6 @@
this.vsbApiLockMouse = false; this.vsbApiLockMouse = false;
this.hsbApiLockMouse = false; this.hsbApiLockMouse = false;
this.__handlers = null; // ToDo избавиться от этой переменной!
return this; return this;
} }
...@@ -668,7 +665,7 @@ ...@@ -668,7 +665,7 @@
/** @param event {KeyboardEvent} */ /** @param event {KeyboardEvent} */
asc_CEventsController.prototype._onWindowKeyDown = function (event) { asc_CEventsController.prototype._onWindowKeyDown = function (event) {
var t = this, dc = 0, dr = 0, isViewerMode = t.settings.isViewerMode; var t = this, dc = 0, dr = 0, isViewerMode = t.settings.isViewerMode, action = false;
var ctrlKey = event.metaKey || event.ctrlKey; var ctrlKey = event.metaKey || event.ctrlKey;
var shiftKey = event.shiftKey; var shiftKey = event.shiftKey;
...@@ -930,85 +927,91 @@ ...@@ -930,85 +927,91 @@
return true; return true;
} }
stop(); switch (event.which) {
case 49:
// Вызовем обработчик if (shiftKey) {
if (!t.__handlers) {
t.__handlers = {
49: function () {
if (!shiftKey) {
return false;
}
t.handlers.trigger("setCellFormat", Asc.c_oAscNumFormatType.Number); t.handlers.trigger("setCellFormat", Asc.c_oAscNumFormatType.Number);
return true; action = true;
}, 50: function () { }
if (!shiftKey) { break;
return false; case 50:
} if (shiftKey) {
t.handlers.trigger("setCellFormat", Asc.c_oAscNumFormatType.Time); t.handlers.trigger("setCellFormat", Asc.c_oAscNumFormatType.Time);
return true; action = true;
}, 51: function () { }
if (!shiftKey) { break;
return false; case 51:
} if (shiftKey) {
t.handlers.trigger("setCellFormat", Asc.c_oAscNumFormatType.Date); t.handlers.trigger("setCellFormat", Asc.c_oAscNumFormatType.Date);
return true; action = true;
}, 52: function () { }
if (!shiftKey) { break;
return false; case 52:
} if (shiftKey) {
t.handlers.trigger("setCellFormat", Asc.c_oAscNumFormatType.Currency); t.handlers.trigger("setCellFormat", Asc.c_oAscNumFormatType.Currency);
return true; action = true;
}, 53: function () { }
if (shiftKey) { break;
t.handlers.trigger("setCellFormat", Asc.c_oAscNumFormatType.Percent); case 53:
} else { if (shiftKey) {
t.handlers.trigger("setFontAttributes", "s"); t.handlers.trigger("setCellFormat", Asc.c_oAscNumFormatType.Percent);
} } else {
return true; t.handlers.trigger("setFontAttributes", "s");
}, 54: function () { }
if (!shiftKey) { action = true;
return false; break;
} case 54:
if (shiftKey) {
t.handlers.trigger("setCellFormat", Asc.c_oAscNumFormatType.Scientific); t.handlers.trigger("setCellFormat", Asc.c_oAscNumFormatType.Scientific);
return true; action = true;
}, 65: function () { }
t.handlers.trigger("changeSelection", /*isStartPoint*/true, -1, -1, /*isCoord*/true, /*isSelectMode*/ break;
false, false); case 65:
return true; t.handlers.trigger("changeSelection", /*isStartPoint*/true, -1, -1, /*isCoord*/true, /*isSelectMode*/
}, 66: function () { false, false);
t.handlers.trigger("setFontAttributes", "b"); action = true;
return true; break;
}, 73: function () { case 66:
t.handlers.trigger("setFontAttributes", "i"); t.handlers.trigger("setFontAttributes", "b");
return true; action = true;
}, 85: function () { break;
t.handlers.trigger("setFontAttributes", "u"); case 73:
return true; t.handlers.trigger("setFontAttributes", "i");
}, 80: function () { action = true;
t.handlers.trigger("print"); break;
return true; case 80:
}, //83: function () {t.handlers.trigger("save");}, t.handlers.trigger("print");
89: function () { action = true;
t.handlers.trigger("redo"); break;
return true; /*case 83:
}, 90: function () { t.handlers.trigger("save");
t.handlers.trigger("undo"); action = true;
return true; break;*/
}, case 85:
192: function () { t.handlers.trigger("setFontAttributes", "u");
if (!shiftKey) { action = true;
return false; break;
} case 89:
t.handlers.trigger("redo");
action = true;
break;
case 90:
t.handlers.trigger("undo");
action = true;
break;
case 192:
if (shiftKey) {
t.handlers.trigger("setCellFormat", Asc.c_oAscNumFormatType.General); t.handlers.trigger("setCellFormat", Asc.c_oAscNumFormatType.General);
return true; action = true;
} }
}; break;
} }
if (!t.__handlers[event.which]()) {
if (!action) {
t.skipKeyPress = false; t.skipKeyPress = false;
return true; return true;
} }
stop();
return result; return result;
case 61: // Firefox, Opera (+/=) case 61: // Firefox, Opera (+/=)
......
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