Commit e1bb3076 authored by Sergey Luzyanin's avatar Sergey Luzyanin

Записываем во флаг fromGroup в свойствах шейпов для мобильной версии можно ли редактировать текст.

parent 7f1ae7e5
...@@ -364,38 +364,49 @@ function DrawingObjectsController(drawingObjects) ...@@ -364,38 +364,49 @@ function DrawingObjectsController(drawingObjects)
this.handleEventMode = HANDLE_EVENT_MODE_HANDLE; this.handleEventMode = HANDLE_EVENT_MODE_HANDLE;
} }
function CanStartEditText(oController)
{
var oSelector = oController.selection.groupSelection ? oController.selection.groupSelection : oController;
if(oSelector.selectedObjects.length === 1 && oSelector.selectedObjects[0].getObjectType() === historyitem_type_Shape)
{
return true;
}
return false;
}
DrawingObjectsController.prototype = DrawingObjectsController.prototype =
{ {
//for mobile spreadsheet editor //for mobile spreadsheet editor
startEditTextCurrentShape: function() startEditTextCurrentShape: function()
{ {
if(!CanStartEditText(this))
{
return;
}
var oSelector = this.selection.groupSelection ? this.selection.groupSelection : this; var oSelector = this.selection.groupSelection ? this.selection.groupSelection : this;
if(oSelector.selectedObjects.length === 1 && oSelector.selectedObjects[0].getObjectType() === historyitem_type_Shape) var oShape = oSelector.selectedObjects[0];
var oContent = oShape.getDocContent();
if(oContent)
{ {
var oShape = oSelector.selectedObjects[0]; oSelector.resetInternalSelection();
var oContent = oShape.getDocContent(); oSelector.selection.textSelection = oShape;
if(oContent) oContent.Cursor_MoveToEndPos(false);
{ this.updateSelectionState();
this.updateOverlay();
}
else
{
var oThis = this;
this.checkSelectedObjectsAndCallback(function(){
oShape.createTextBody();
var oContent = oShape.getDocContent();
oSelector.resetInternalSelection(); oSelector.resetInternalSelection();
oSelector.selection.textSelection = oShape; oSelector.selection.textSelection = oShape;
oContent.Cursor_MoveToEndPos(false); oContent.Cursor_MoveToEndPos(false);
this.updateSelectionState(); oThis.updateSelectionState();
this.updateOverlay(); }, [], false, historydescription_Spreadsheet_AddNewParagraph);
}
else
{
var oThis = this;
this.checkSelectedObjectsAndCallback(function(){
oShape.createTextBody();
var oContent = oShape.getDocContent();
oSelector.resetInternalSelection();
oSelector.selection.textSelection = oShape;
oContent.Cursor_MoveToEndPos(false);
oThis.updateSelectionState();
}, [], false, historydescription_Spreadsheet_AddNewParagraph);
}
} }
}, },
...@@ -6629,7 +6640,7 @@ DrawingObjectsController.prototype = ...@@ -6629,7 +6640,7 @@ DrawingObjectsController.prototype =
if (isRealObject(props.shapeProps)) if (isRealObject(props.shapeProps))
{ {
shape_props = new asc_CImgProperty(); shape_props = new asc_CImgProperty();
shape_props.fromGroup = props.shapeProps.fromGroup; shape_props.fromGroup = CanStartEditText(this);
shape_props.ShapeProperties = new asc_CShapeProperty(); shape_props.ShapeProperties = new asc_CShapeProperty();
shape_props.ShapeProperties.type = props.shapeProps.type; shape_props.ShapeProperties.type = props.shapeProps.type;
shape_props.ShapeProperties.fill = props.shapeProps.fill; shape_props.ShapeProperties.fill = props.shapeProps.fill;
......
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