Commit 95bf33d7 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Поправил выставление диапазона при undo/redo для объектов

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57429 954022d7-b5bf-4e40-9824-e11837661b57
parent d173872a
......@@ -1791,7 +1791,7 @@ function DrawingObjects() {
}
}
}
return new asc_Range( cmin, rmin, cmax, rmax, true );
return new asc.ActiveRange(cmin, rmin, cmax, rmax, true);
};
_this.recalculate = function(all)
......
......@@ -107,17 +107,15 @@
* @param {WorkbookView} view
* @param {Element} widgetElem
* @param {Element} canvasElem
* @param {Object} handlers Event handlers (resize, reinitializeScroll, scrollY, scrollX, changeSelection, updateWorksheet, editCell, stopCellEditing)
* @param {Object} settings
* @param {Object} handlers Event handlers (resize, reinitializeScroll, scrollY, scrollX, changeSelection, ...)
*/
asc_CEventsController.prototype.init = function (view, widgetElem, canvasElem, handlers, settings) {
asc_CEventsController.prototype.init = function (view, widgetElem, canvasElem, handlers) {
var self = this;
this.view = view;
this.widget = widgetElem;
this.element = canvasElem;
this.handlers = new asc.asc_CHandlersList(handlers);
this.settings = $.extend(true, {}, this.settings, settings);
this._createScrollBars();
if( this.view.Api.isMobileVersion ){
var __hasTouch = 'ontouchstart' in window;
......@@ -223,7 +221,7 @@
this.isSelectionDialogMode = isSelectionDialogMode;
};
/** @param whichSB {Number} Scroll bar to reinit (1=vertical, 2=horizontal) */
/** @param [whichSB] {Number} Scroll bar to reinit (1=vertical, 2=horizontal) */
asc_CEventsController.prototype.reinitializeScroll = function (whichSB) {
if (window["NATIVE_EDITOR_ENJINE"])
return;
......@@ -257,10 +255,10 @@
/**
* @param delta {Number}
* @param event {MouseEvent}
* @param [event] {MouseEvent}
*/
asc_CEventsController.prototype.scrollVertical = function (delta, event) {
if( event && event.preventDefault )
if (event && event.preventDefault)
event.preventDefault();
this.vsbApi.scrollByY(this.settings.vscrollStep * delta);
return true;
......@@ -268,7 +266,7 @@
/**
* @param delta {Number}
* @param event {MouseEvent}
* @param [event] {MouseEvent}
*/
asc_CEventsController.prototype.scrollHorizontal = function (delta, event) {
if (event && event.preventDefault)
......@@ -518,12 +516,8 @@
this.handlers.trigger("changeFillHandle", coord.x, coord.y,
function (d) {
if (!d) return;
if (d.deltaX) {
t.scrollHorizontal(d.deltaX);
}
if (d.deltaY) {
t.scrollVertical(d.deltaY);
}
if (d.deltaX) {t.scrollHorizontal(d.deltaX);}
if (d.deltaY) {t.scrollVertical(d.deltaY);}
asc_applyFunction(callback);
});
};
......@@ -568,12 +562,8 @@
this.handlers.trigger("moveRangeHandle", coord.x, coord.y,
function (d) {
if (!d) return;
if (d.deltaX) {
t.scrollHorizontal(d.deltaX);
}
if (d.deltaY) {
t.scrollVertical(d.deltaY);
}
if (d.deltaX) {t.scrollHorizontal(d.deltaX);}
if (d.deltaY) {t.scrollVertical(d.deltaY);}
asc_applyFunction(callback);
}, event.metaKey || event.ctrlKey);
};
......@@ -611,12 +601,8 @@
this.handlers.trigger("moveResizeRangeHandle", coord.x, coord.y, target,
function (d) {
if (!d) return;
if (d.deltaX) {
t.scrollHorizontal(d.deltaX);
}
if (d.deltaY) {
t.scrollVertical(d.deltaY);
}
if (d.deltaX) {t.scrollHorizontal(d.deltaX);}
if (d.deltaY) {t.scrollVertical(d.deltaY);}
asc_applyFunction(callback);
});
};
......
......@@ -48,7 +48,7 @@
* Widget for displaying and editing Workbook object
* -----------------------------------------------------------------------------
* @param {Workbook} model Workbook
* @param {asc.asc_CEventsController} controller Events controller
* @param {asc_CEventsController} controller Events controller
* @param {HandlersList} handlers Events handlers for WorkbookView events
* @param {Element} elem Container element
* @param {Element} inputElem Input element for top line editor
......@@ -599,7 +599,7 @@
this.showWorksheet(state[0].worksheet.index);
ws.setSelectionShape(true);
ws.objectRender.controller.setSelectionState(state);
var d = ws.setSelectionUndoRedoObject(ws.objectRender.getSelectedDrawingsRange());
var d = ws._calcActiveCellOffset(ws.objectRender.getSelectedDrawingsRange());
if (d) {
if (d.deltaX) {this.controller.scrollHorizontal(d.deltaX);}
if (d.deltaY) {this.controller.scrollVertical(d.deltaY);}
......@@ -816,7 +816,7 @@
// Обработка перемещения диапазона
WorkbookView.prototype._onMoveRangeHandle = function (x, y, callback,ctrlKey) {
var ws = this.getWorksheet();
var d = ws.changeSelectionMoveRangeHandle(x, y,ctrlKey);
var d = ws.changeSelectionMoveRangeHandle(x, y, ctrlKey);
asc_applyFunction(callback, d);
};
......@@ -1175,7 +1175,7 @@
/**
*
* @param index
* @param isResized
* @param [isResized]
* @returns {WorkbookView}
*/
WorkbookView.prototype.showWorksheet = function (index, isResized) {
......
......@@ -6215,9 +6215,13 @@
};
};
WorksheetView.prototype._calcActiveCellOffset = function () {
/**
* @param {ActiveRange} [range]
* @returns {{deltaX: number, deltaY: number}}
*/
WorksheetView.prototype._calcActiveCellOffset = function (range) {
var vr = this.visibleRange;
var ar = this.activeRange;
var ar = range ? range : this.activeRange;
var arn = ar.clone(true);
var isMC = this._isMergedCells(arn);
var adjustRight = ar.startCol >= vr.c2 || ar.startCol >= vr.c2 && isMC;
......@@ -6717,11 +6721,6 @@
return oRes;
};
WorksheetView.prototype.setSelectionUndoRedoObject = function (range) {
this._shiftVisibleRange(range);
return this._calcActiveCellOffset();
};
WorksheetView.prototype.changeSelectionStartPoint = function (x, y, isCoord, isSelectMode) {
var ar = (this.isFormulaEditMode) ? this.arrActiveFormulaRanges[this.arrActiveFormulaRanges.length - 1]: this.activeRange;
......
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