diff --git a/apps/documenteditor/main/app/view/LeftMenu.js b/apps/documenteditor/main/app/view/LeftMenu.js index cb52b3db1..34ff99204 100644 --- a/apps/documenteditor/main/app/view/LeftMenu.js +++ b/apps/documenteditor/main/app/view/LeftMenu.js @@ -257,7 +257,7 @@ define([ /** coauthoring end **/ close: function(menu) { - if ( this.menuFile.$el.is(':visible') ) { + if ( this.menuFile.isVisible() ) { this.menuFile.hide(); Common.NotificationCenter.trigger('layout:changed', 'menufile'); } else { diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index ce8ea0d18..e8ba66e9f 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -65,6 +65,16 @@ define([ var $panels, $marker, $scrollL; var lastPanel; + var config = { + tabs: [ + { caption: 'File', action: 'file'}, + { caption: 'Home', action: 'home'}, + { caption: 'Insert', action: 'ins'}, + { caption: 'Page Layout', action: 'layout'}, + { caption: 'Plugins', action: 'plugins' } + ] + }; + function hasTabInvisible() { var _left_bound_ = $boxTabs.offset().left, _right_bound_ = _left_bound_ + $boxTabs.width(); @@ -109,7 +119,7 @@ define([ el: '#toolbar', // Compile our stats template - template: _.template(template), + // template: _.template(template), // Delegated events for creating new items, and clearing completed ones. events: { @@ -117,6 +127,8 @@ define([ }, initialize: function () { + config.$dom = $(_.template(template, config)); + /** * UI Components */ @@ -1230,29 +1242,7 @@ define([ var value = Common.localStorage.getItem("de-compact-toolbar"); var valueCompact = !!(value !== null && parseInt(value) == 1 || value === null && mode.customization && mode.customization.compactToolbar); - var _tpl_ = this.template({ - tabs: [{ - caption: 'File', - action: 'file' - }, { - caption: 'Home', - action: 'home' - }, { - caption: 'Insert', - action: 'ins' - }, { - caption: 'Page Layout', - action: 'layout' - }, { - caption: 'Review', - action: 'review' - }, { - caption: 'Plugins', - action: 'plugins' - }] - }); - - me.$el.html(me.rendererComponents(_tpl_)); + me.$el.html( me.rendererComponents(config.$dom) ); me.isCompactView = valueCompact; @@ -2286,6 +2276,30 @@ define([ } }, + addTab: function (tab, panel, after) { + var _tplTab = '