From c8e40f6d0325e604102f6a854fb7792075eed87e Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Thu, 6 Apr 2017 12:42:43 +0300 Subject: [PATCH] [DE] refactoring --- apps/common/main/lib/view/Header.js | 8 +++++--- apps/documenteditor/main/app/controller/Toolbar.js | 2 ++ apps/documenteditor/main/app/view/Toolbar.js | 13 ++++++++----- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js index 81756eadb..c13303413 100644 --- a/apps/common/main/lib/view/Header.js +++ b/apps/common/main/lib/view/Header.js @@ -300,9 +300,11 @@ define([ }); - (new Promise(function (accept, reject) { - Common.NotificationCenter.on('app:ready', function(mode) { accept(mode); }); - })).then(onAppReady.bind(me)); + Common.NotificationCenter.on('app:ready', function(mode) { + (new Promise(function (accept, reject) { + accept(mode); + })).then(onAppReady.bind(me)); + }); }, render: function (el, role) { diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 88f0d8e38..546dd7323 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -2769,8 +2769,10 @@ define([ }); if ( _btnsComment.length ) { + var _comments = DE.getController('Common.Controllers.Comments').getView(); Array.prototype.push.apply(me.toolbar.toolbarControls, _btnsComment); _btnsComment.forEach(function (btn) { + btn.updateHint( _comments.textAddComment ); btn.on('click', function (btn, e) { Common.NotificationCenter.trigger('app:comment:add', 'toolbar'); }); diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index 06b45d4a5..4bcfdad10 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -1349,8 +1349,7 @@ define([ me.isCompactView = Common.localStorage.getBool("de-compact-toolbar"); /** coauthoring begin **/ - value = Common.localStorage.getItem("de-hide-synch"); - this.showSynchTip = !(value && parseInt(value) == 1); + this.showSynchTip = !Common.localStorage.getBool("de-hide-synch"); this.needShowSynchTip = false; /** coauthoring end **/ @@ -2158,9 +2157,9 @@ define([ this.mnuitemCompactToolbar.setChecked(this.isCompactView, true); this.mnuitemCompactToolbar.on('toggle', _.bind(this.changeViewMode, this)); - this.mnuitemHideTitleBar.setChecked(valueTitle, true); - this.mnuitemHideStatusBar.setChecked(valueStatus, true); - this.mnuitemHideRulers.setChecked(valueRulers, true); + this.mnuitemHideTitleBar.setChecked( Common.localStorage.getBool("de-hidden-title"), true ); + this.mnuitemHideStatusBar.setChecked( Common.localStorage.getBool("de-hidden-status"), true ); + this.mnuitemHideRulers.setChecked( Common.localStorage.getBool("de-hidden-rulers"), true ); /**/ }, @@ -2535,6 +2534,10 @@ define([ } }, + isCompact: function () { + return isFolded; + }, + textBold: 'Bold', textItalic: 'Italic', textUnderline: 'Underline',