[PE] Fix align objects from context menu
This commit is contained in:
parent
df9336fec8
commit
8d6d66891a
|
@ -2564,11 +2564,20 @@ define([
|
||||||
menu : (function(){
|
menu : (function(){
|
||||||
function onItemClick(item) {
|
function onItemClick(item) {
|
||||||
if (me.api) {
|
if (me.api) {
|
||||||
me.api.put_ShapesAlign(item.value);
|
var value = me.api.asc_getSelectedDrawingObjectsCount()<2 || Common.Utils.InternalSettings.get("pe-align-to-slide");
|
||||||
|
value = value ? Asc.c_oAscObjectsAlignType.Slide : Asc.c_oAscObjectsAlignType.Selected;
|
||||||
|
if (item.value < 6) {
|
||||||
|
me.api.put_ShapesAlign(item.value, value);
|
||||||
|
Common.component.Analytics.trackEvent('DocumentHolder', 'Shape Align');
|
||||||
|
} else if (item.value == 6) {
|
||||||
|
me.api.DistributeHorizontally(value);
|
||||||
|
Common.component.Analytics.trackEvent('DocumentHolder', 'Distribute Horizontally');
|
||||||
|
} else if (item.value == 7){
|
||||||
|
me.api.DistributeVertically(value);
|
||||||
|
Common.component.Analytics.trackEvent('DocumentHolder', 'Distribute Vertically');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
me.fireEvent('editcomplete', me);
|
me.fireEvent('editcomplete', me);
|
||||||
Common.component.Analytics.trackEvent('DocumentHolder', 'Image Shape Align');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Common.UI.Menu({
|
return new Common.UI.Menu({
|
||||||
|
@ -2607,26 +2616,14 @@ define([
|
||||||
{caption : '--'},
|
{caption : '--'},
|
||||||
new Common.UI.MenuItem({
|
new Common.UI.MenuItem({
|
||||||
caption : me.txtDistribHor,
|
caption : me.txtDistribHor,
|
||||||
iconCls : 'mnu-distrib-hor'
|
iconCls : 'mnu-distrib-hor',
|
||||||
}).on('click', function(item) {
|
value : 6
|
||||||
if (me.api) {
|
}).on('click', _.bind(onItemClick, me)),
|
||||||
me.api.DistributeHorizontally();
|
|
||||||
}
|
|
||||||
|
|
||||||
me.fireEvent('editcomplete', me);
|
|
||||||
Common.component.Analytics.trackEvent('DocumentHolder', 'Distribute Horizontally');
|
|
||||||
}),
|
|
||||||
new Common.UI.MenuItem({
|
new Common.UI.MenuItem({
|
||||||
caption : me.txtDistribVert,
|
caption : me.txtDistribVert,
|
||||||
iconCls : 'mnu-distrib-vert'
|
iconCls : 'mnu-distrib-vert',
|
||||||
}).on('click', function(item) {
|
value : 7
|
||||||
if (me.api) {
|
}).on('click', _.bind(onItemClick, me))
|
||||||
me.api.DistributeVertically();
|
|
||||||
}
|
|
||||||
|
|
||||||
me.fireEvent('editcomplete', me);
|
|
||||||
Common.component.Analytics.trackEvent('DocumentHolder', 'Distribute Vertically');
|
|
||||||
})
|
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
})()
|
})()
|
||||||
|
@ -3200,6 +3197,12 @@ define([
|
||||||
menuAddCommentImg.setDisabled(disabled);
|
menuAddCommentImg.setDisabled(disabled);
|
||||||
/** coauthoring end **/
|
/** coauthoring end **/
|
||||||
menuImgShapeAlign.setDisabled(disabled);
|
menuImgShapeAlign.setDisabled(disabled);
|
||||||
|
if (!disabled) {
|
||||||
|
var objcount = me.api.asc_getSelectedDrawingObjectsCount(),
|
||||||
|
slide_checked = Common.Utils.InternalSettings.get("pe-align-to-slide") || false;
|
||||||
|
menuImgShapeAlign.menu.items[7].setDisabled(objcount==2 && !slide_checked);
|
||||||
|
menuImgShapeAlign.menu.items[8].setDisabled(objcount==2 && !slide_checked);
|
||||||
|
}
|
||||||
menuImageAdvanced.setDisabled(disabled);
|
menuImageAdvanced.setDisabled(disabled);
|
||||||
menuShapeAdvanced.setDisabled(disabled);
|
menuShapeAdvanced.setDisabled(disabled);
|
||||||
if (menuChartEdit.isVisible())
|
if (menuChartEdit.isVisible())
|
||||||
|
|
|
@ -1762,8 +1762,8 @@ define([
|
||||||
textTabCollaboration: 'Collaboration',
|
textTabCollaboration: 'Collaboration',
|
||||||
textTabProtect: 'Protection',
|
textTabProtect: 'Protection',
|
||||||
mniImageFromStorage: 'Image from Storage',
|
mniImageFromStorage: 'Image from Storage',
|
||||||
txtSlideAlign: 'Align to slide',
|
txtSlideAlign: 'Align to Slide',
|
||||||
txtObjectsAlign: 'Align selected objects'
|
txtObjectsAlign: 'Align Selected Objects'
|
||||||
}
|
}
|
||||||
}()), PE.Views.Toolbar || {}));
|
}()), PE.Views.Toolbar || {}));
|
||||||
});
|
});
|
|
@ -1747,7 +1747,6 @@
|
||||||
"PE.Views.Toolbar.txtScheme8": "Flow",
|
"PE.Views.Toolbar.txtScheme8": "Flow",
|
||||||
"PE.Views.Toolbar.txtScheme9": "Foundry",
|
"PE.Views.Toolbar.txtScheme9": "Foundry",
|
||||||
"PE.Views.Toolbar.txtUngroup": "Ungroup",
|
"PE.Views.Toolbar.txtUngroup": "Ungroup",
|
||||||
"PE.Views.Toolbar.txtSlideAlign": "Align to slide",
|
"PE.Views.Toolbar.txtSlideAlign": "Align to Slide",
|
||||||
"PE.Views.Toolbar.txtObjectsAlign": "Align selected objects"
|
"PE.Views.Toolbar.txtObjectsAlign": "Align Selected Objects"
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue