From b0326651d7a1e892e6f6c9568fb561aec48a85a5 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 12 Jan 2022 16:54:46 +0300 Subject: [PATCH] [DE] Add separators for wrapping menu --- .../main/app/controller/PageLayout.js | 14 ++++---- .../main/app/view/DocumentHolder.js | 32 ++++++++++--------- apps/documenteditor/main/app/view/Toolbar.js | 8 +++-- 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/apps/documenteditor/main/app/controller/PageLayout.js b/apps/documenteditor/main/app/controller/PageLayout.js index 222538d4a..06c3a6bdd 100644 --- a/apps/documenteditor/main/app/controller/PageLayout.js +++ b/apps/documenteditor/main/app/controller/PageLayout.js @@ -107,12 +107,12 @@ define([ switch ( type ) { case Asc.c_oAscWrapStyle2.Inline: menu.items[0].setChecked(true); break; - case Asc.c_oAscWrapStyle2.Square: menu.items[1].setChecked(true); break; - case Asc.c_oAscWrapStyle2.Tight: menu.items[2].setChecked(true); break; - case Asc.c_oAscWrapStyle2.Through: menu.items[3].setChecked(true); break; - case Asc.c_oAscWrapStyle2.TopAndBottom: menu.items[4].setChecked(true); break; - case Asc.c_oAscWrapStyle2.Behind: menu.items[6].setChecked(true); break; - case Asc.c_oAscWrapStyle2.InFront: menu.items[5].setChecked(true); break; + case Asc.c_oAscWrapStyle2.Square: menu.items[2].setChecked(true); break; + case Asc.c_oAscWrapStyle2.Tight: menu.items[3].setChecked(true); break; + case Asc.c_oAscWrapStyle2.Through: menu.items[4].setChecked(true); break; + case Asc.c_oAscWrapStyle2.TopAndBottom: menu.items[5].setChecked(true); break; + case Asc.c_oAscWrapStyle2.Behind: menu.items[8].setChecked(true); break; + case Asc.c_oAscWrapStyle2.InFront: menu.items[7].setChecked(true); break; default: for (var i in menu.items) { menu.items[i].setChecked( false ); @@ -140,7 +140,7 @@ define([ _.each(me.toolbar.btnImgWrapping.menu.items, function(item) { item.setDisabled(notflow); }); - me.toolbar.btnImgWrapping.menu.items[8].setDisabled(!me.api.CanChangeWrapPolygon()); + me.toolbar.btnImgWrapping.menu.items[10].setDisabled(!me.api.CanChangeWrapPolygon()); var control_props = me.api.asc_IsContentControl() ? this.api.asc_GetContentControlProperties() : null, lock_type = (control_props) ? control_props.get_Lock() : Asc.c_oAscSdtLockType.Unlocked, diff --git a/apps/documenteditor/main/app/view/DocumentHolder.js b/apps/documenteditor/main/app/view/DocumentHolder.js index a9b03c443..79bd02b9c 100644 --- a/apps/documenteditor/main/app/view/DocumentHolder.js +++ b/apps/documenteditor/main/app/view/DocumentHolder.js @@ -1637,22 +1637,22 @@ define([ this.menuImageWrap.menu.items[0].setChecked(true); break; case Asc.c_oAscWrapStyle2.Square: - this.menuImageWrap.menu.items[1].setChecked(true); - break; - case Asc.c_oAscWrapStyle2.Tight: this.menuImageWrap.menu.items[2].setChecked(true); break; - case Asc.c_oAscWrapStyle2.Through: + case Asc.c_oAscWrapStyle2.Tight: this.menuImageWrap.menu.items[3].setChecked(true); break; - case Asc.c_oAscWrapStyle2.TopAndBottom: + case Asc.c_oAscWrapStyle2.Through: this.menuImageWrap.menu.items[4].setChecked(true); break; + case Asc.c_oAscWrapStyle2.TopAndBottom: + this.menuImageWrap.menu.items[5].setChecked(true); + break; case Asc.c_oAscWrapStyle2.Behind: - this.menuImageWrap.menu.items[6].setChecked(true); + this.menuImageWrap.menu.items[8].setChecked(true); break; case Asc.c_oAscWrapStyle2.InFront: - this.menuImageWrap.menu.items[5].setChecked(true); + this.menuImageWrap.menu.items[7].setChecked(true); break; } }, @@ -2329,6 +2329,7 @@ define([ checkmark : false, checkable : true }).on('click', onItemClick), + { caption: '--' }, new Common.UI.MenuItem({ caption : me.txtSquare, iconCls : 'menu__icon wrap-square', @@ -2361,6 +2362,7 @@ define([ checkmark : false, checkable : true }).on('click', onItemClick), + { caption: '--' }, new Common.UI.MenuItem({ caption : me.txtInFront, iconCls : 'menu__icon wrap-infront', @@ -2616,7 +2618,7 @@ define([ var cls = 'menu__icon '; if (notflow) { - for (var i = 0; i < 6; i++) { + for (var i = 0; i < 8; i++) { me.menuImageWrap.menu.items[i].setChecked(false); } cls += 'wrap-inline'; @@ -2627,31 +2629,31 @@ define([ cls += 'wrap-inline'; break; case Asc.c_oAscWrapStyle2.Square: - me.menuImageWrap.menu.items[1].setChecked(true); + me.menuImageWrap.menu.items[2].setChecked(true); cls += 'wrap-square'; break; case Asc.c_oAscWrapStyle2.Tight: - me.menuImageWrap.menu.items[2].setChecked(true); + me.menuImageWrap.menu.items[3].setChecked(true); cls += 'wrap-tight'; break; case Asc.c_oAscWrapStyle2.Through: - me.menuImageWrap.menu.items[3].setChecked(true); + me.menuImageWrap.menu.items[4].setChecked(true); cls += 'wrap-through'; break; case Asc.c_oAscWrapStyle2.TopAndBottom: - me.menuImageWrap.menu.items[4].setChecked(true); + me.menuImageWrap.menu.items[5].setChecked(true); cls += 'wrap-topandbottom'; break; case Asc.c_oAscWrapStyle2.Behind: - me.menuImageWrap.menu.items[6].setChecked(true); + me.menuImageWrap.menu.items[8].setChecked(true); cls += 'wrap-behind'; break; case Asc.c_oAscWrapStyle2.InFront: - me.menuImageWrap.menu.items[5].setChecked(true); + me.menuImageWrap.menu.items[7].setChecked(true); cls += 'wrap-infront'; break; default: - for (var i = 0; i < 6; i++) { + for (var i = 0; i < 8; i++) { me.menuImageWrap.menu.items[i].setChecked(false); } cls += 'wrap-infront'; diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index 5e6b1d1df..078b3242e 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -1720,7 +1720,9 @@ define([ wrapType : Asc.c_oAscWrapStyle2.Inline, checkmark : false, checkable : true - }, { + }, + { caption: '--' }, + { caption : _holder_view.txtSquare, iconCls : 'menu__icon wrap-square', toggleGroup : 'imgwrapping', @@ -1748,7 +1750,9 @@ define([ wrapType : Asc.c_oAscWrapStyle2.TopAndBottom, checkmark : false, checkable : true - }, { + }, + { caption: '--' }, + { caption : _holder_view.txtInFront, iconCls : 'menu__icon wrap-infront', toggleGroup : 'imgwrapping',