Commit 4da628df authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

asc_setSelectDialogRangeMode -> asc_setSelectionDialogMode

В функцию asc_setSelectionDialogMode добавил второй параметр (диапазон для стартового выделения)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48373 954022d7-b5bf-4e40-9824-e11837661b57
parent afae06fc
......@@ -2408,12 +2408,13 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
/**
* Режим выбора диапазона
* @param {Boolean} isSelectDialogRangeMode
* @param {Boolean} isSelectionDialogMode
* @param selectRange
*/
asc_setSelectDialogRangeMode: function (isSelectDialogRangeMode) {
this.controller.setSelectDialogRangeMode(isSelectDialogRangeMode);
asc_setSelectionDialogMode: function (isSelectionDialogMode, selectRange) {
this.controller.setSelectionDialogMode(isSelectionDialogMode);
if (this.wb)
this.wb.setSelectDialogRangeMode(isSelectDialogRangeMode);
this.wb.setSelectionDialogMode(isSelectionDialogMode, selectRange);
},
asc_SendThemeColors : function (colors, standart_colors) {
......@@ -3021,7 +3022,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
prot["asc_insertFormula"] = prot.asc_insertFormula;
prot["asc_getFormulasInfo"] = prot.asc_getFormulasInfo;
prot["asc_setFontRenderingMode"] = prot.asc_setFontRenderingMode;
prot["asc_setSelectDialogRangeMode"] = prot.asc_setSelectDialogRangeMode;
prot["asc_setSelectionDialogMode"] = prot.asc_setSelectionDialogMode;
prot["asc_ChangeColorScheme"] = prot.asc_ChangeColorScheme;
/////////////////////////////////////////////////////////////////////////
///////////////////CoAuthoring and Chat api//////////////////////////////
......
......@@ -2080,10 +2080,10 @@
addFilterDialog.dialog({ autoOpen: false, closeOnEscape: false, dialogClass: 'dialogClass',
open: function() {
api.asc_setSelectDialogRangeMode(true);
api.asc_setSelectionDialogMode(true);
aDialogNames.push("addFilterDialog");
},
close: function() { aDialogNames.pop(); api.asc_setSelectDialogRangeMode(false);},
close: function() { aDialogNames.pop(); api.asc_setSelectionDialogMode(false);},
resizable: false, modal: false, width: '350px',
buttons: [
{
......@@ -2129,7 +2129,7 @@
function setAxisXFont() { showChartFontDialog(chart.asc_getXAxis().asc_getTitleFont()) }
function setAxisYFont() { showChartFontDialog(chart.asc_getYAxis().asc_getTitleFont()) }
api.asc_setSelectDialogRangeMode(true);
api.asc_setSelectionDialogMode(true);
chartForm.css("visibility", "visible");
chartForm.dialog({ autoOpen: false, closeOnEscape: true, height: 'auto', width: 400,
......@@ -2261,7 +2261,7 @@
],
close: function() {
if (!bIsReopenDialog)
api.asc_setSelectDialogRangeMode(false);
api.asc_setSelectionDialogMode(false);
api.asc_enableKeyEvents(true);
// chart font unbinding
......@@ -2316,7 +2316,7 @@
],
close: function() {
if (!bIsReopenDialog)
api.asc_setSelectDialogRangeMode(false);
api.asc_setSelectionDialogMode(false);
api.asc_enableKeyEvents(true);
},
create: function() {
......
......@@ -59,7 +59,7 @@
this.isMoveResizeRange = false;
this.isMoveResizeChartsRange = false;
// Режим select-а для диалогов
this.isSelectDialogRangeMode = false;
this.isSelectionDialogMode = false;
// Режим формулы
this.isFormulaEditMode = false;
this.endWasPressed = false;
......@@ -195,10 +195,10 @@
/**
*
* @param {Boolean} isSelectDialogRangeMode
* @param {Boolean} isSelectionDialogMode
*/
setSelectDialogRangeMode: function (isSelectDialogRangeMode) {
this.isSelectDialogRangeMode = isSelectDialogRangeMode;
setSelectionDialogMode: function (isSelectionDialogMode) {
this.isSelectionDialogMode = isSelectionDialogMode;
},
/** @param whichSB {Number} Scroll bar to reinit (1=vertical, 2=horizontal) */
......@@ -248,7 +248,7 @@
var t = this;
// Для формулы не нужно выходить из редактирования ячейки
if (t.settings.isViewerMode || t.isFormulaEditMode || t.isSelectDialogRangeMode) {return true;}
if (t.settings.isViewerMode || t.isFormulaEditMode || t.isSelectionDialogMode) {return true;}
if( this.targetInfo && ( this.targetInfo.target == "moveResizeRange" || this.targetInfo.target == "moveRange" || this.targetInfo.target == "fillhandle" ) ){
return true;
......@@ -638,7 +638,7 @@
switch (event.which) {
case 113: // F2
if (isViewerMode || t.isCellEditMode || t.isSelectDialogRangeMode) {return true;}
if (isViewerMode || t.isCellEditMode || t.isSelectionDialogMode) {return true;}
if ($.browser.opera) {stop();}
// Выставляем блокировку на выход из редактора по клавишам-стрелкам
t.strictClose = true;
......@@ -647,7 +647,7 @@
return t.__retval;
case 8: // backspace
if (isViewerMode || t.isCellEditMode || t.isSelectDialogRangeMode) {return true;}
if (isViewerMode || t.isCellEditMode || t.isSelectionDialogMode) {return true;}
if (t.isSelectDrawingObject) {
t.handlers.trigger("deleteDrawingObjectDone");
t.isSelectDrawingObject = false;
......@@ -662,7 +662,7 @@
return true;
case 46: // Del
if (isViewerMode || t.isCellEditMode || t.isSelectDialogRangeMode) {return true;}
if (isViewerMode || t.isCellEditMode || t.isSelectionDialogMode) {return true;}
// Удаляем содержимое
if (t.isSelectDrawingObject) {
t.handlers.trigger("deleteDrawingObjectDone");
......@@ -805,7 +805,7 @@
case 88: // cut Ctrl + x
case 89: // redo Ctrl + y
case 90: // undo Ctrl + z
if (isViewerMode || t.isSelectDialogRangeMode) {stop(); return false;}
if (isViewerMode || t.isSelectionDialogMode) {stop(); return false;}
case 65: // select all Ctrl + a
case 67: // copy Ctrl + c
......@@ -838,7 +838,7 @@
case 61: // Firefox, Opera (+/=)
case 187: // +/=
if (isViewerMode || t.isCellEditMode || t.isSelectDialogRangeMode) {return true;}
if (isViewerMode || t.isCellEditMode || t.isSelectionDialogMode) {return true;}
if (event.altKey) {
t.handlers.trigger("addFunction", /*functionName*/"SUM", /*autoComplet*/true);
......@@ -903,7 +903,7 @@
// не вводим текст в режиме просмотра
// если в FF возвращать false, то отменяется дальнейшая обработка серии keydown -> keypress -> keyup
// и тогда у нас не будут обрабатываться ctrl+c и т.п. события
if (t.settings.isViewerMode || t.isSelectDialogRangeMode) {return true;}
if (t.settings.isViewerMode || t.isSelectionDialogMode) {return true;}
var graphicObjects = t.handlers.trigger("getSelectedGraphicObjects");
if ( graphicObjects.length ) {
......
......@@ -1309,8 +1309,8 @@
}
},
setSelectDialogRangeMode: function (isSelectDialogRangeMode) {
this.getWorksheet().setSelectDialogRangeMode(isSelectDialogRangeMode);
setSelectionDialogMode: function (isSelectionDialogMode, selectRange) {
this.getWorksheet().setSelectionDialogMode(isSelectionDialogMode, selectRange);
},
// Поиск текста в листе
......
......@@ -427,9 +427,8 @@
this.isChartAreaEditMode = false;
this.lockDraw = false;
this.isSelectDialogRangeMode = false;
this.isSelectionDialogMode = false;
this.copyOfActiveRange = null;
this.newSelectRange = null; // Диапазон, который будет на начало выбора диапазона
this.startCellMoveResizeRange = null;
this.startCellMoveResizeRange2 = null;
......@@ -2760,7 +2759,7 @@
* @param {Asc.Range} range
*/
_drawSelection: function (range) {
if (!this.isSelectDialogRangeMode) {
if (!this.isSelectionDialogMode) {
this._drawCollaborativeElements(/*bIsDrawObjects*/true);
this._drawSelectionRange(range);
this.cellCommentator.drawCommentCells(false);
......@@ -2779,7 +2778,7 @@
this.activeRange.c2 = this.cols.length - 1;
}
if (!this.isSelectDialogRangeMode)
if (!this.isSelectionDialogMode)
range = this.activeRange.intersection(range !== undefined ? range : this.visibleRange);
else
range = this.copyOfActiveRange.intersection(range !== undefined ? range : this.visibleRange);
......@@ -2803,7 +2802,7 @@
var opt = this.settings;
var offsetX = this.cols[this.visibleRange.c1].left - this.cellsLeft;
var offsetY = this.rows[this.visibleRange.r1].top - this.cellsTop;
var arn = (!this.isSelectDialogRangeMode) ? this.activeRange.clone(true) : this.copyOfActiveRange.clone(true);
var arn = (!this.isSelectionDialogMode) ? this.activeRange.clone(true) : this.copyOfActiveRange.clone(true);
var x1 = (range) ? (this.cols[range.c1].left - offsetX) : 0;
var x2 = (range) ? (this.cols[range.c2].left + this.cols[range.c2].width - offsetX) : 0;
var y1 = (range) ? (this.rows[range.r1].top - offsetY) : 0;
......@@ -2923,7 +2922,7 @@
ctx.setFillStyle( opt.activeCellBackground )
.fillRect(lRect, tRect, rRect - lRect, bRect - tRect);
var firstCell = (!this.isSelectDialogRangeMode) ? this.activeRange : this.copyOfActiveRange;
var firstCell = (!this.isSelectionDialogMode) ? this.activeRange : this.copyOfActiveRange;
cr = this._getMergedCellsRange(firstCell.startCol, firstCell.startRow);
// Получаем активную ячейку в выделении
cr = range.intersection(cr !== undefined ? cr : asc_Range(firstCell.startCol, firstCell.startRow, firstCell.startCol, firstCell.startRow));
......@@ -2989,7 +2988,7 @@
this._drawFormulaRange(this.arrActiveChartsRanges)
}
if (this.isSelectDialogRangeMode) {
if (this.isSelectionDialogMode) {
this._drawSelectRange(this.activeRange.clone(true));
}
......@@ -5864,7 +5863,7 @@
}
if (!this.isCellEditMode && (sc !== ar.startCol || sr !== ar.startRow)) {
if (!this.isSelectDialogRangeMode) {
if (!this.isSelectionDialogMode) {
this._trigger("selectionNameChanged", this.getSelectionName(/*bRangeText*/false));
if (!isSelectMode)
this._trigger("selectionChanged", this.getSelectionInfo());
......@@ -5991,7 +5990,7 @@
ret = this._calcActiveRangeOffset();
if (!this.isCellEditMode && !arnOld.isEqual(ar.clone(true))) {
if (!this.isSelectDialogRangeMode) {
if (!this.isSelectionDialogMode) {
this._trigger("selectionNameChanged", this.getSelectionName(/*bRangeText*/true));
if (!isSelectMode)
this._trigger("selectionChanged", this.getSelectionInfo(false));
......@@ -8766,20 +8765,13 @@
return this.isFormulaEditMode;
},
// Функция выставляет диапазон для будующего селекта диапазона (ToDo стоит сделать по другому)
_setSelectDialogRange: function (newRange) {
if (this.isSelectDialogRangeMode)
setSelectionDialogMode: function (isSelectionDialogMode, selectRange) {
if (isSelectionDialogMode === this.isSelectionDialogMode)
return;
this.newSelectRange = newRange.clone();
},
setSelectDialogRangeMode: function (isSelectDialogRangeMode) {
if (isSelectDialogRangeMode === this.isSelectDialogRangeMode)
return;
this.isSelectDialogRangeMode = isSelectDialogRangeMode;
this.isSelectionDialogMode = isSelectionDialogMode;
this.cleanSelection();
if (false === this.isSelectDialogRangeMode) {
if (false === this.isSelectionDialogMode) {
if (null !== this.copyOfActiveRange) {
this.activeRange = this.copyOfActiveRange.clone(true);
this.activeRange.startCol = this.copyOfActiveRange.startCol;
......@@ -8790,11 +8782,12 @@
this.copyOfActiveRange = this.activeRange.clone(true);
this.copyOfActiveRange.startCol = this.activeRange.startCol;
this.copyOfActiveRange.startRow = this.activeRange.startRow;
if (this.newSelectRange) {
this.activeRange = this.newSelectRange.clone(true);
this.activeRange.startCol = this.newSelectRange.startCol;
this.activeRange.startRow = this.newSelectRange.startRow;
this.newSelectRange = null;
if (selectRange) {
selectRange = parserHelp.parse3DRef(selectRange);
if (selectRange) {
// ToDo стоит менять и лист
this.activeRange = selectRange.range;
}
}
}
......
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