From c525a793623c7fec0dbe71bfa776ec291a1097f7 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 14 Jun 2018 16:40:27 +0300 Subject: [PATCH] [SSE] Open table settings after table is added --- .../main/app/controller/RightMenu.js | 10 ++++++++-- .../main/app/controller/Toolbar.js | 18 ++++++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/RightMenu.js b/apps/spreadsheeteditor/main/app/controller/RightMenu.js index 517b7e34d..8f7e14c09 100644 --- a/apps/spreadsheeteditor/main/app/controller/RightMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/RightMenu.js @@ -61,7 +61,8 @@ define([ 'insertimage': this.onInsertImage.bind(this), 'insertshape': this.onInsertShape.bind(this), 'insertchart': this.onInsertChart.bind(this), - 'inserttextart': this.onInsertTextArt.bind(this) + 'inserttextart': this.onInsertTextArt.bind(this), + 'inserttable': this.onInsertTable.bind(this) }, 'RightMenu': { 'rightmenuclick': this.onRightMenuClick @@ -257,6 +258,7 @@ define([ this._settings[Common.Utils.documentSettingsType.Image].needShow = false; this._settings[Common.Utils.documentSettingsType.Chart].needShow = false; + this._settings[Common.Utils.documentSettingsType.Table].needShow = false; }, onCoAuthoringDisconnect: function() { @@ -279,7 +281,11 @@ define([ onInsertTextArt: function() { this._settings[Common.Utils.documentSettingsType.TextArt].needShow = true; }, - + + onInsertTable: function() { + this._settings[Common.Utils.documentSettingsType.Table].needShow = true; + }, + UpdateThemeColors: function() { this.rightmenu.shapeSettings.UpdateThemeColors(); this.rightmenu.textartSettings.UpdateThemeColors(); diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 65882edbb..871dba69f 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -2806,12 +2806,17 @@ define([ buttons: ['ok', 'cancel'], callback: function(btn) { if (btn == 'ok') - setTimeout(function() { me.api.asc_addAutoFilter(fmtname, settings.range)}, 1); + setTimeout(function() { + me.toolbar.fireEvent('inserttable', me.toolbar); + me.api.asc_addAutoFilter(fmtname, settings.range); + }, 1); Common.NotificationCenter.trigger('edit:complete', me.toolbar); } }); - else + else { + me.toolbar.fireEvent('inserttable', me.toolbar); me.api.asc_addAutoFilter(fmtname, settings.range); + } } } @@ -2841,12 +2846,17 @@ define([ buttons: ['ok', 'cancel'], callback: function(btn) { if (btn == 'ok') - setTimeout(function() { me.api.asc_addAutoFilter(fmtname)}, 1); + setTimeout(function() { + me.toolbar.fireEvent('inserttable', me.toolbar); + me.api.asc_addAutoFilter(fmtname); + }, 1); Common.NotificationCenter.trigger('edit:complete', me.toolbar); } }); - else + else { + me.toolbar.fireEvent('inserttable', me.toolbar); me.api.asc_addAutoFilter(fmtname); + } } } }