Commit 7b208013 authored by Dmitry.Vikulov's avatar Dmitry.Vikulov Committed by Alexander.Trofimov

Селект объектов через Tab

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48381 954022d7-b5bf-4e40-9824-e11837661b57
parent d8920654
......@@ -4270,27 +4270,6 @@ function DrawingObjects() {
return false;
}
_this.selectDrawingObjectEx = function(index, bNext) {
if (_this.checkDrawingObjectIndex(index)) {
var toIndex = index;
_this.unselectDrawingObjects();
if (bNext) {
if (index + 1 < _this.countDrawingObjects())
_this.selectDrawingObject(index + 1);
else
_this.selectDrawingObject(0);
}
else {
if ((index - 1 >= 0) && (index - 1 < _this.countDrawingObjects()))
_this.selectDrawingObject(index - 1);
else
_this.selectDrawingObject(_this.countDrawingObjects() - 1);
}
}
}
_this.selectDrawingObjectRange = function(id) {
worksheet.arrActiveChartsRanges = [];
......
......@@ -276,12 +276,38 @@ function NullState(drawingObjectsController, drawingObjects)
this.onKeyDown = function(e)
{
var b_prevent_default = false;
var selected_objects = this.drawingObjectsController.selectedObjects;
switch (e.keyCode)
{
case 8:
{
b_prevent_default = true;
}
case 9: // Tab (селект объектов)
{
var aObjects = this.drawingObjectsController.drawingObjects.getDrawingObjects();
if ( aObjects.length > 1 ) {
var lastSelectedId = selected_objects[selected_objects.length - 1].Id;
this.drawingObjectsController.resetSelectionState();
for (var i = 0; i < aObjects.length; i++) {
if ( aObjects[i].graphicObject.Id == lastSelectedId ) {
var index = i;
if ( e.shiftKey ) // назад
index = (i > 0) ? i - 1 : aObjects.length - 1;
else
index = (i < aObjects.length - 1) ? i + 1 : 0;
aObjects[index].graphicObject.select(this.drawingObjectsController);
this.drawingObjectsController.drawingObjects.showDrawingObjects(true);
break;
}
}
}
}
}
if(b_prevent_default)
e.preventDefault();
......
......@@ -677,8 +677,6 @@
// Отключим стандартную обработку браузера нажатия tab
stop();
// Селект по drawing-объектам
if ( !t.handlers.trigger("selectDrawingObjectEx", !event.shiftKey) ) {
// Особый случай (возможно движение в выделенной области)
selectionActivePointChanged = true;
if (event.shiftKey){
......@@ -687,7 +685,6 @@
} else {
dc = +1; // (tab) - движение по ячейкам вправо на 1 столбец
}
}
break;
case 13: // "enter"
......
......@@ -172,7 +172,6 @@
"moveResizeRangeHandle": function () {self._onMoveResizeRangeHandle.apply(self, arguments);},
"moveResizeRangeHandleDone":function () {self._onMoveResizeRangeHandleDone.apply(self, arguments);},
"deleteDrawingObjectDone": function () {self._onDeleteDrawingObjectDone.apply(self);},
"selectDrawingObjectEx": function () {return self._onSelectDrawingObjectEx.apply(self, arguments);},
"editCell": function () {self._onEditCell.apply(self, arguments);},
"stopCellEditing": function () {return self._onStopCellEditing.apply(self, arguments);},
"emptyCell": function () {self._onEmptyCell.apply(self, arguments);},
......@@ -584,17 +583,6 @@
ws.autoFilters.drawAutoF(ws);
},
_onSelectDrawingObjectEx: function (bNext) {
var result = false;
var ws = this.getWorksheet();
var index = ws.objectRender.getSelectedDrawingObjectIndex();
if ( index >= 0 ) {
ws.objectRender.selectDrawingObjectEx(index, bNext);
result = true;
}
return result;
},
// Обработка автозаполнения
_onChangeFillHandle: function (x, y, callback) {
var ws = this.getWorksheet();
......
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