[DE] refactoring

This commit is contained in:
Maxim Kadushkin 2017-04-06 12:42:43 +03:00
parent 360cca6601
commit c8e40f6d03
3 changed files with 15 additions and 8 deletions

View file

@ -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) {

View file

@ -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');
});

View file

@ -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',