From 7016660299ff48392d3192a326f1c3a4b820eef8 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 30 Sep 2020 18:52:11 +0300 Subject: [PATCH] [DE] Open content control settings after it's creating --- apps/documenteditor/main/app/controller/Main.js | 5 +++++ apps/documenteditor/main/app/controller/RightMenu.js | 5 +++++ apps/documenteditor/main/app/controller/Toolbar.js | 1 + 3 files changed, 11 insertions(+) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 6d3284d4d..0e40df49c 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1356,6 +1356,7 @@ define([ toolbarView.on('insertshape', _.bind(me.onInsertShape, me)); toolbarView.on('inserttextart', _.bind(me.onInsertTextArt, me)); toolbarView.on('insertchart', _.bind(me.onInsertChart, me)); + toolbarView.on('insertcontrol', _.bind(me.onInsertControl, me)); } var value = Common.localStorage.getItem('de-settings-unit'); @@ -2032,6 +2033,10 @@ define([ this.getApplication().getController('RightMenu').onInsertTextArt(); }, + onInsertControl: function() { + this.getApplication().getController('RightMenu').onInsertControl(); + }, + unitsChanged: function(m) { var value = Common.localStorage.getItem("de-settings-unit"); value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric(); diff --git a/apps/documenteditor/main/app/controller/RightMenu.js b/apps/documenteditor/main/app/controller/RightMenu.js index 7f4d50648..ded26a120 100644 --- a/apps/documenteditor/main/app/controller/RightMenu.js +++ b/apps/documenteditor/main/app/controller/RightMenu.js @@ -261,6 +261,11 @@ define([ this._settings[Common.Utils.documentSettingsType.TextArt].needShow = true; }, + onInsertControl: function() { + if (this._settings[Common.Utils.documentSettingsType.Form]) + this._settings[Common.Utils.documentSettingsType.Form].needShow = true; + }, + UpdateThemeColors: function() { this.rightmenu.paragraphSettings.UpdateThemeColors(); this.rightmenu.tableSettings.UpdateThemeColors(); diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index b2b2974bf..c4a38d633 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -1835,6 +1835,7 @@ define([ oPr, oFormPr; if (isnew) { oFormPr = new AscCommon.CSdtFormPr(); + this.toolbar.fireEvent('insertcontrol', this.toolbar); } if (item.value == 'plain' || item.value == 'rich') this.api.asc_AddContentControl((item.value=='plain') ? Asc.c_oAscSdtLevelType.Inline : Asc.c_oAscSdtLevelType.Block);