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) {
return false;
} }
break;
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) {
return false;
} }
break;
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) {
return false;
} }
break;
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 () { }
break;
case 53:
if (shiftKey) { if (shiftKey) {
t.handlers.trigger("setCellFormat", Asc.c_oAscNumFormatType.Percent); t.handlers.trigger("setCellFormat", Asc.c_oAscNumFormatType.Percent);
} else { } else {
t.handlers.trigger("setFontAttributes", "s"); t.handlers.trigger("setFontAttributes", "s");
} }
return true; action = true;
}, 54: function () { break;
if (!shiftKey) { case 54:
return false; if (shiftKey) {
}
t.handlers.trigger("setCellFormat", Asc.c_oAscNumFormatType.Scientific); t.handlers.trigger("setCellFormat", Asc.c_oAscNumFormatType.Scientific);
return true; action = true;
}, 65: function () { }
break;
case 65:
t.handlers.trigger("changeSelection", /*isStartPoint*/true, -1, -1, /*isCoord*/true, /*isSelectMode*/ t.handlers.trigger("changeSelection", /*isStartPoint*/true, -1, -1, /*isCoord*/true, /*isSelectMode*/
false, false); false, false);
return true; action = true;
}, 66: function () { break;
case 66:
t.handlers.trigger("setFontAttributes", "b"); t.handlers.trigger("setFontAttributes", "b");
return true; action = true;
}, 73: function () { break;
case 73:
t.handlers.trigger("setFontAttributes", "i"); t.handlers.trigger("setFontAttributes", "i");
return true; action = true;
}, 85: function () { break;
t.handlers.trigger("setFontAttributes", "u"); case 80:
return true;
}, 80: function () {
t.handlers.trigger("print"); t.handlers.trigger("print");
return true; action = true;
}, //83: function () {t.handlers.trigger("save");}, break;
89: function () { /*case 83:
t.handlers.trigger("save");
action = true;
break;*/
case 85:
t.handlers.trigger("setFontAttributes", "u");
action = true;
break;
case 89:
t.handlers.trigger("redo"); t.handlers.trigger("redo");
return true; action = true;
}, 90: function () { break;
case 90:
t.handlers.trigger("undo"); t.handlers.trigger("undo");
return true; action = true;
}, break;
192: function () { case 192:
if (!shiftKey) { if (shiftKey) {
return false;
}
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