From 13b623ef0c714d97242783788c66ed69d077f3f3 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 23 Aug 2017 11:02:04 +0300 Subject: [PATCH] Fix Bug 35525. + Set focus to document after "insert table" dialog is closed. --- apps/documenteditor/main/app/controller/Main.js | 16 +++++++++++++++- .../main/app/controller/Toolbar.js | 2 +- .../main/app/view/DocumentHolder.js | 3 +-- .../main/app/view/TableSettings.js | 2 +- .../main/app/controller/Main.js | 14 ++++++++++++++ .../main/app/controller/Toolbar.js | 2 +- .../main/app/view/DocumentHolder.js | 2 +- .../main/app/view/TableSettings.js | 2 +- 8 files changed, 35 insertions(+), 8 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index f7f1496e1..5ae6e85e9 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1306,6 +1306,20 @@ define([ this.api.asc_DownloadAs(); else (this.appOptions.canDownload) ? this.getApplication().getController('LeftMenu').leftMenu.showMenu('file:saveas') : this.api.asc_DownloadOrigin(); + } else if (id == Asc.c_oAscError.ID.SplitCellMaxRows || id == Asc.c_oAscError.ID.SplitCellMaxCols || id == Asc.c_oAscError.ID.SplitCellRowsDivider) { + var me = this; + setTimeout(function(){ + (new Common.Views.InsertTableDialog({ + split: true, + handler: function(result, value) { + if (result == 'ok') { + if (me.api) + me.api.SplitCell(value.columns, value.rows); + } + me.onEditComplete(); + } + })).show(); + },10); } this._state.lostEditingRights = false; this.onEditComplete(); @@ -1760,7 +1774,7 @@ define([ Common.localStorage.setItem("de-settings-showchanges-strict", 'last'); this.api.SetCollaborativeMarksShowType(Asc.c_oAscCollaborativeMarksShowType.LastChanges); } - this.fireEvent('editcomplete', this); + this.onEditComplete(); }, this) }); }, diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 7c5daef0f..e68803d8e 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -1363,9 +1363,9 @@ define([ me.api.put_Table(value.columns, value.rows); } - Common.NotificationCenter.trigger('edit:complete', me.toolbar); Common.component.Analytics.trackEvent('ToolBar', 'Table'); } + Common.NotificationCenter.trigger('edit:complete', me.toolbar); } })).show(); } diff --git a/apps/documenteditor/main/app/view/DocumentHolder.js b/apps/documenteditor/main/app/view/DocumentHolder.js index 1608246f3..b32e32c73 100644 --- a/apps/documenteditor/main/app/view/DocumentHolder.js +++ b/apps/documenteditor/main/app/view/DocumentHolder.js @@ -2314,10 +2314,9 @@ define([ if (me.api) { me.api.SplitCell(value.columns, value.rows); } - me.fireEvent('editcomplete', me); - Common.component.Analytics.trackEvent('DocumentHolder', 'Table'); } + me.fireEvent('editcomplete', me); } })).show(); } diff --git a/apps/documenteditor/main/app/view/TableSettings.js b/apps/documenteditor/main/app/view/TableSettings.js index cf0ecc039..babc878c2 100644 --- a/apps/documenteditor/main/app/view/TableSettings.js +++ b/apps/documenteditor/main/app/view/TableSettings.js @@ -243,8 +243,8 @@ define([ if (me.api) { me.api.SplitCell(value.columns, value.rows); } - me.fireEvent('editcomplete', me); } + me.fireEvent('editcomplete', me); } })).show(); }, diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 66792829a..4e94ea4be 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -1061,6 +1061,20 @@ define([ if (id == Asc.c_oAscError.ID.Warning && btn == 'ok' && this.appOptions.canDownload) { Common.UI.Menu.Manager.hideAll(); (this.appOptions.isDesktopApp && this.appOptions.isOffline) ? this.api.asc_DownloadAs() : this.getApplication().getController('LeftMenu').leftMenu.showMenu('file:saveas'); + } else if (id == Asc.c_oAscError.ID.SplitCellMaxRows || id == Asc.c_oAscError.ID.SplitCellMaxCols || id == Asc.c_oAscError.ID.SplitCellRowsDivider) { + var me = this; + setTimeout(function(){ + (new Common.Views.InsertTableDialog({ + split: true, + handler: function(result, value) { + if (result == 'ok') { + if (me.api) + me.api.SplitCell(value.columns, value.rows); + } + me.onEditComplete(); + } + })).show(); + },10); } this._state.lostEditingRights = false; this.onEditComplete(); diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index 6f42f5adc..690af686a 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -1328,9 +1328,9 @@ define([ me.api.put_Table(value.columns, value.rows); } - Common.NotificationCenter.trigger('edit:complete', me.toolbar); Common.component.Analytics.trackEvent('ToolBar', 'Table'); } + Common.NotificationCenter.trigger('edit:complete', me.toolbar); } })).show(); } diff --git a/apps/presentationeditor/main/app/view/DocumentHolder.js b/apps/presentationeditor/main/app/view/DocumentHolder.js index 2a024dd7a..207903d55 100644 --- a/apps/presentationeditor/main/app/view/DocumentHolder.js +++ b/apps/presentationeditor/main/app/view/DocumentHolder.js @@ -1981,9 +1981,9 @@ define([ if (me.api) { me.api.SplitCell(value.columns, value.rows); } - me.fireEvent('editcomplete', me); Common.component.Analytics.trackEvent('DocumentHolder', 'Table Split'); } + me.fireEvent('editcomplete', me); } })).show(); } diff --git a/apps/presentationeditor/main/app/view/TableSettings.js b/apps/presentationeditor/main/app/view/TableSettings.js index bf751e82a..815b66760 100644 --- a/apps/presentationeditor/main/app/view/TableSettings.js +++ b/apps/presentationeditor/main/app/view/TableSettings.js @@ -209,8 +209,8 @@ define([ if (me.api) { me.api.SplitCell(value.columns, value.rows); } - me.fireEvent('editcomplete', me); } + me.fireEvent('editcomplete', me); } })).show(); },