From 931011ca423afef0bc1edeae304444eeb1232a7a Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Thu, 17 May 2018 13:44:46 +0300 Subject: [PATCH] [All] changed default tab option for compact toolbar --- apps/common/main/lib/component/Mixtbar.js | 5 +++-- apps/documenteditor/main/app/controller/Toolbar.js | 2 +- apps/presentationeditor/main/app/controller/Toolbar.js | 2 +- apps/spreadsheeteditor/main/app/controller/Toolbar.js | 2 +- apps/spreadsheeteditor/main/app/view/Toolbar.js | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/common/main/lib/component/Mixtbar.js b/apps/common/main/lib/component/Mixtbar.js index 0360db278..667b36449 100644 --- a/apps/common/main/lib/component/Mixtbar.js +++ b/apps/common/main/lib/component/Mixtbar.js @@ -135,7 +135,7 @@ define([ return t.length && t.data('tab') == tag; }, - setFolded: function(value, deftab) { + setFolded: function(value) { this.isFolded = value; var me = this; @@ -194,7 +194,8 @@ define([ var tab = active_panel.data('tab'); me.$tabs.find('> a[data-tab=' + tab + ']').parent().toggleClass('active', true); } else { - me.setTab(deftab); + tab = me.$tabs.siblings(':not(.x-lone)').first().find('> a[data-tab]').data('tab'); + me.setTab(tab); } } }, diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index d08a7b27b..5239dd925 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -364,7 +364,7 @@ define([ }, onChangeCompactView: function(view, compact) { - this.toolbar.setFolded(compact, this.appOptions.isEdit ? 'home' : 'plugins'); + this.toolbar.setFolded(compact); this.toolbar.fireEvent('view:compact', [this, compact]); Common.localStorage.setBool('de-compact-toolbar', compact); diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index ab226bd8f..79dd28c62 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -354,7 +354,7 @@ define([ }, onChangeCompactView: function(view, compact) { - this.toolbar.setFolded(compact, this.appOptions.isEdit ? 'home' : 'plugins'); + this.toolbar.setFolded(compact); this.toolbar.fireEvent('view:compact', [this.toolbar, compact]); Common.localStorage.setBool('pe-compact-toolbar', compact); diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index defb6014b..7e8d8c0d3 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -1458,7 +1458,7 @@ define([ }, onChangeViewMode: function(item, compact) { - this.toolbar.setFolded(compact, this.appOptions.isEdit ? 'home' : 'plugins'); + this.toolbar.setFolded(compact); this.toolbar.fireEvent('view:compact', [this, compact]); Common.localStorage.setBool('sse-compact-toolbar', compact); diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 47b6bcc35..d3557be92 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -1219,7 +1219,7 @@ define([ compactview = true; if (!compactview) { - me.setFolded(false, 1); + me.setFolded(false); me.setTab('plugins'); me.fireEvent('view:compact', [me, compactview]); Common.NotificationCenter.trigger('layout:changed', 'toolbar');