From f2df650781693b1358ee6844bb43d93fd50b9ab6 Mon Sep 17 00:00:00 2001 From: OVSharova Date: Wed, 3 Nov 2021 02:25:17 +0300 Subject: [PATCH] Refactoring --- .../main/app/view/ImageSettings.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/apps/documenteditor/main/app/view/ImageSettings.js b/apps/documenteditor/main/app/view/ImageSettings.js index f5e7e0ff0..47d1dfaaf 100644 --- a/apps/documenteditor/main/app/view/ImageSettings.js +++ b/apps/documenteditor/main/app/view/ImageSettings.js @@ -338,23 +338,22 @@ define([ fillAutoShapes: function() { var me = this, recents = Common.localStorage.getItem('de-recent-shapes'); - - for (var i = 0; i < 2; i++) { - var menuitem = new Common.UI.MenuItem({ - template: _.template(''), - index: i + + var menuitem = new Common.UI.MenuItem({ + template: _.template(''), + index: 0 }); me.btnChangeShape.menu.addItem(menuitem); var shapePicker = new Common.UI.DataViewShape({ - el: $('#id-change-shape-menu-' + i), + el: $('#id-img-change-shape-menu-' + 0), itemTemplate: _.template('
\">
'), groups: me.application.getCollection('ShapeGroups'), parentMenu: me.btnChangeShape.menu, restoreHeight: 640, textRecentlyUsed: me.textRecentlyUsed, recentShapes: recents ? JSON.parse(recents) : null, - isFromImage: i === 0 + isFromImage: true }); shapePicker.on('item:click', function(picker, item, record, e) { if (me.api) { @@ -364,9 +363,6 @@ define([ if (e.type !== 'click') me.btnChangeShape.menu.hide(); }); - } - /*me.btnChangeShape.menu.items[0].setVisible(me._state.isFromImage); - me.btnChangeShape.menu.items[1].setVisible(!me._state.isFromImage);*/ }, ChangeSettings: function(props) { @@ -376,6 +372,7 @@ define([ this.disableControls(this._locked); if (props ){ + this._originalProps = new Asc.asc_CImgProperty(props); var value = props.get_WrappingStyle();