Commit 80db0cf0 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Обработал нажатие горячих клавиш в окне выбора вариантов подстановки для формул

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55389 954022d7-b5bf-4e40-9824-e11837661b57
parent 1b9101f5
......@@ -684,6 +684,13 @@
t.skipKeyPress = true;
if (!t.isCellEditMode) {
if (!t.handlers.trigger("popUpSelectorKeyDown", event)) {
stop();
return t.__retval;
}
}
switch (event.which) {
case 113: // F2
......@@ -803,9 +810,6 @@
case 38: // up
stop(); // Отключим стандартную обработку браузера нажатия up
if (!t.handlers.trigger("popUpSelectorKeyDown", event))
return t.__retval;
dr = event.ctrlKey ? -1.5 : -1; // Движение стрелками (влево-вправо, вверх-вниз)
break;
......@@ -821,8 +825,6 @@
t.handlers.trigger("showAutoComplete");
return t.__retval;
}
if (!t.handlers.trigger("popUpSelectorKeyDown", event))
return t.__retval;
dr = event.ctrlKey ? +1.5 : +1; // Движение стрелками (влево-вправо, вверх-вниз)
break;
......
......@@ -113,8 +113,16 @@
var retVal = false;
switch (event.which) {
case 9: // Tab
if (this.isFormula)
this._onMouseDblClick();
else
retVal = true;
break;
case 13: // "enter"
if (!this.isFormula && null !== this.selectElement)
this._onInsert(this.selectElement.innerHTML);
else
retVal = true;
break;
case 27: // Esc
this.hide();
......@@ -133,13 +141,17 @@
return retVal;
};
PopUpSelector.prototype._onInsert = function (value) {
this.hide();
this.handlers.trigger("insert", value);
};
PopUpSelector.prototype._onMouseDown = function (event) {
var element = (event.target || event.srcElement);
if (this.isFormula) {
this._onChangeSelection(element);
} else {
this.hide();
this.handlers.trigger("insert", element.innerHTML);
this._onInsert(element.innerHTML);
}
};
PopUpSelector.prototype._onMouseDblClick = function (event) {
......@@ -150,9 +162,8 @@
this._onMouseDown(event);
return;
}
var elementVal = (event.target || event.srcElement).innerHTML + "(";
this.hide();
this.handlers.trigger("insert", elementVal);
var elementVal = (event ? (event.target || event.srcElement) : this.selectElement).innerHTML + "(";
this._onInsert(elementVal);
};
PopUpSelector.prototype._onChangeSelection = function (newElement) {
if (null === newElement)
......
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