Commit 192ecba8 authored by Dmitry.Vikulov's avatar Dmitry.Vikulov Committed by Alexander.Trofimov

public isViewerMode

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48647 954022d7-b5bf-4e40-9824-e11837661b57
parent ab0d2701
...@@ -1503,7 +1503,6 @@ function DrawingObjects() { ...@@ -1503,7 +1503,6 @@ function DrawingObjects() {
var api = asc["editor"]; var api = asc["editor"];
var chartRender = new ChartRender(); var chartRender = new ChartRender();
var worksheet = null; var worksheet = null;
var isViewerMode = null;
var drawingCtx = null; var drawingCtx = null;
var overlayCtx = null; var overlayCtx = null;
...@@ -1520,6 +1519,7 @@ function DrawingObjects() { ...@@ -1520,6 +1519,7 @@ function DrawingObjects() {
var userId = null; var userId = null;
var documentId = null; var documentId = null;
_this.isViewerMode = null;
_this.objectLocker = null; _this.objectLocker = null;
_this.drawingDocument = null; _this.drawingDocument = null;
_this.asyncImageEndLoaded = null; _this.asyncImageEndLoaded = null;
...@@ -1901,7 +1901,7 @@ function DrawingObjects() { ...@@ -1901,7 +1901,7 @@ function DrawingObjects() {
_this.drawingDocument.TargetHtmlElement = document.getElementById('id_target_cursor'); _this.drawingDocument.TargetHtmlElement = document.getElementById('id_target_cursor');
_this.drawingDocument.InitGuiCanvasShape(api.shapeElementId); _this.drawingDocument.InitGuiCanvasShape(api.shapeElementId);
isViewerMode = function() { return worksheet._trigger("getViewerMode"); }; _this.isViewerMode = function() { return worksheet._trigger("getViewerMode"); };
aObjects = []; aObjects = [];
aImagesSync = []; aImagesSync = [];
...@@ -2064,7 +2064,6 @@ function DrawingObjects() { ...@@ -2064,7 +2064,6 @@ function DrawingObjects() {
} }
} */ } */
shapeOverlayCtx.m_oContext.clearRect(0, 0, shapeOverlayCtx.m_lWidthPix, shapeOverlayCtx.m_lHeightPix); shapeOverlayCtx.m_oContext.clearRect(0, 0, shapeOverlayCtx.m_lWidthPix, shapeOverlayCtx.m_lHeightPix);
// Селекты для комментариев, фильтров и т.д. // Селекты для комментариев, фильтров и т.д.
...@@ -2230,6 +2229,12 @@ function DrawingObjects() { ...@@ -2230,6 +2229,12 @@ function DrawingObjects() {
function restoreSheetArea(checker) { function restoreSheetArea(checker) {
/*var _w = checker.Bounds.max_x - checker.Bounds.min_x;
var _h = checker.Bounds.max_y - checker.Bounds.min_y;
overlayCtx.clearRect( mmToPt(checker.Bounds.min_x + pxToMm(scrollOffset.x)), mmToPt(checker.Bounds.min_y + pxToMm(scrollOffset.y)), mmToPt(_w + pxToMm(scrollOffset.x)), mmToPt(_h + pxToMm(scrollOffset.y)));
drawingCtx.clearRect( mmToPt(checker.Bounds.min_x + pxToMm(scrollOffset.x)), mmToPt(checker.Bounds.min_y + pxToMm(scrollOffset.y)), mmToPt(_w + pxToMm(scrollOffset.x)), mmToPt(_h + pxToMm(scrollOffset.y)));*/
var foundRow = worksheet._findRowUnderCursor( mmToPt(checker.Bounds.min_y + pxToMm(scrollOffset.y)), true); var foundRow = worksheet._findRowUnderCursor( mmToPt(checker.Bounds.min_y + pxToMm(scrollOffset.y)), true);
var topRow = foundRow ? foundRow.row : 0; var topRow = foundRow ? foundRow.row : 0;
var foundCol = worksheet._findColUnderCursor( mmToPt(checker.Bounds.min_x + pxToMm(scrollOffset.x)), true); var foundCol = worksheet._findColUnderCursor( mmToPt(checker.Bounds.min_x + pxToMm(scrollOffset.x)), true);
...@@ -2335,8 +2340,9 @@ function DrawingObjects() { ...@@ -2335,8 +2340,9 @@ function DrawingObjects() {
}*/ }*/
} }
} }
_this.raiseLayerDrawingObjects(); //_this.raiseLayerDrawingObjects();
_this.selectGraphicObject(); //_this.selectGraphicObject();
_this.OnUpdateOverlay();
} }
_this.showOverlayGraphicObjects = function() { _this.showOverlayGraphicObjects = function() {
...@@ -2410,7 +2416,7 @@ function DrawingObjects() { ...@@ -2410,7 +2416,7 @@ function DrawingObjects() {
_this.addImageDrawingObject = function(imageUrl, bPackage, options) { _this.addImageDrawingObject = function(imageUrl, bPackage, options) {
if (imageUrl && !isViewerMode()) { if ( imageUrl && !_this.isViewerMode() ) {
var _image = api.ImageLoader.LoadImage(imageUrl, 1); var _image = api.ImageLoader.LoadImage(imageUrl, 1);
var isOption = options && options.cell; var isOption = options && options.cell;
...@@ -2569,7 +2575,7 @@ function DrawingObjects() { ...@@ -2569,7 +2575,7 @@ function DrawingObjects() {
_this.addChartDrawingObject = function(chart, bWithoutHistory, options) { _this.addChartDrawingObject = function(chart, bWithoutHistory, options) {
if (isViewerMode()) if ( _this.isViewerMode() )
return; return;
var wordChart = null; var wordChart = null;
...@@ -2658,7 +2664,7 @@ function DrawingObjects() { ...@@ -2658,7 +2664,7 @@ function DrawingObjects() {
var bResult = false; var bResult = false;
if ( !isViewerMode() ) { if ( !_this.isViewerMode() ) {
if ( _this.controller.selectedObjects.length ) { if ( _this.controller.selectedObjects.length ) {
...@@ -3234,7 +3240,7 @@ function DrawingObjects() { ...@@ -3234,7 +3240,7 @@ function DrawingObjects() {
} }
_this.selectGraphicObject = function() { _this.selectGraphicObject = function() {
if ( _this.drawingDocument && _this.controller.selectedObjects.length ) { /*if ( _this.drawingDocument && _this.controller.selectedObjects.length ) {
// Сначала селект диапазона диаграммы // Сначала селект диапазона диаграммы
for (var i = 0; i < _this.controller.selectedObjects.length; i++) { for (var i = 0; i < _this.controller.selectedObjects.length; i++) {
...@@ -3247,7 +3253,7 @@ function DrawingObjects() { ...@@ -3247,7 +3253,7 @@ function DrawingObjects() {
_this.raiseLayerDrawingObjects(); _this.raiseLayerDrawingObjects();
_this.OnUpdateOverlay(); _this.OnUpdateOverlay();
} }
_this.drawWorksheetHeaders(); _this.drawWorksheetHeaders();*/
} }
_this.setScrollOffset = function(x_px, y_px) { _this.setScrollOffset = function(x_px, y_px) {
...@@ -3407,6 +3413,14 @@ function DrawingObjects() { ...@@ -3407,6 +3413,14 @@ function DrawingObjects() {
_this.controller.onMouseUp( e, pxToMm(x - scrollOffset.x), pxToMm(y - scrollOffset.y) ); _this.controller.onMouseUp( e, pxToMm(x - scrollOffset.x), pxToMm(y - scrollOffset.y) );
} }
_this.graphicObjectKeyDown = function(e) {
_this.controller.onKeyDown( e );
}
_this.graphicObjectKeyPress = function(e) {
_this.controller.onKeyPress( e );
}
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
// Asc // Asc
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
...@@ -3816,7 +3830,7 @@ function DrawingObjects() { ...@@ -3816,7 +3830,7 @@ function DrawingObjects() {
_this.showImageFileDialog = function(documentId, documentFormat) { _this.showImageFileDialog = function(documentId, documentFormat) {
if (isViewerMode()) if ( _this.isViewerMode() )
return; return;
var oImageUploader = document.getElementById("apiImageUpload"); var oImageUploader = document.getElementById("apiImageUpload");
......
...@@ -684,12 +684,12 @@ ...@@ -684,12 +684,12 @@
_onGraphicObjectWindowKeyDown: function (e) { _onGraphicObjectWindowKeyDown: function (e) {
var ws = this.getWorksheet(); var ws = this.getWorksheet();
return ws.objectRender.controller.onKeyDown(e); return ws.objectRender.graphicObjectKeyDown(e);
}, },
_onGraphicObjectWindowKeyPress: function (e) { _onGraphicObjectWindowKeyPress: function (e) {
var ws = this.getWorksheet(); var ws = this.getWorksheet();
return ws.objectRender.controller.onKeyPress(e); return ws.objectRender.graphicObjectKeyPress(e);
}, },
_onGetGraphicsInfo: function (x, y) { _onGetGraphicsInfo: function (x, y) {
......
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