[PE] Disable distribute for two or less objects when use "Align selected objects" option

This commit is contained in:
Julia Radzhabova 2019-02-11 13:16:24 +03:00
parent 55c9a030d3
commit df9336fec8
2 changed files with 15 additions and 10 deletions

View file

@ -1216,6 +1216,8 @@ define([
this.toolbar.mniAlignObjects.setDisabled(value<2); this.toolbar.mniAlignObjects.setDisabled(value<2);
this.toolbar.mniAlignObjects.setChecked(value>1 && !slide_checked, true); this.toolbar.mniAlignObjects.setChecked(value>1 && !slide_checked, true);
this.toolbar.mniAlignToSlide.setChecked(value<2 || slide_checked, true); this.toolbar.mniAlignToSlide.setChecked(value<2 || slide_checked, true);
this.toolbar.mniDistribHor.setDisabled(value<3 && this.toolbar.mniAlignObjects.isChecked());
this.toolbar.mniDistribVert.setDisabled(value<3 && this.toolbar.mniAlignObjects.isChecked());
}, },
onShapeAlign: function(menu, item) { onShapeAlign: function(menu, item) {

View file

@ -607,6 +607,17 @@ define([
Common.Utils.InternalSettings.set("pe-align-to-slide", false); Common.Utils.InternalSettings.set("pe-align-to-slide", false);
}); });
me.mniDistribHor = new Common.UI.MenuItem({
caption: me.txtDistribHor,
iconCls: 'mnu-distrib-hor',
value: 6
});
me.mniDistribVert = new Common.UI.MenuItem({
caption: me.txtDistribVert,
iconCls: 'mnu-distrib-vert',
value: 7
});
me.btnShapeAlign = new Common.UI.Button({ me.btnShapeAlign = new Common.UI.Button({
id: 'id-toolbar-btn-shape-align', id: 'id-toolbar-btn-shape-align',
cls: 'btn-toolbar', cls: 'btn-toolbar',
@ -645,16 +656,8 @@ define([
value: Asc.c_oAscAlignShapeType.ALIGN_BOTTOM value: Asc.c_oAscAlignShapeType.ALIGN_BOTTOM
}, },
{caption: '--'}, {caption: '--'},
{ me.mniDistribHor,
caption: me.txtDistribHor, me.mniDistribVert,
iconCls: 'mnu-distrib-hor',
value: 6
},
{
caption: me.txtDistribVert,
iconCls: 'mnu-distrib-vert',
value: 7
},
{caption: '--'}, {caption: '--'},
me.mniAlignToSlide, me.mniAlignToSlide,
me.mniAlignObjects me.mniAlignObjects