Hide Plugins tab when no plugins. Hide Review tab when no buttons on this tab (for the future).
This commit is contained in:
parent
20ea8595ba
commit
8cce90d8f0
|
@ -92,6 +92,10 @@ define([
|
||||||
|
|
||||||
config.tabs = options.tabs;
|
config.tabs = options.tabs;
|
||||||
$(document.body).on('click', onClickDocument.bind(this));
|
$(document.body).on('click', onClickDocument.bind(this));
|
||||||
|
|
||||||
|
Common.NotificationCenter.on('tab:visible', _.bind(function(action, visible){
|
||||||
|
this.setVisible(action, visible)
|
||||||
|
}, this));
|
||||||
},
|
},
|
||||||
|
|
||||||
afterRender: function() {
|
afterRender: function() {
|
||||||
|
@ -253,7 +257,7 @@ define([
|
||||||
return config.tabs[index].action;
|
return config.tabs[index].action;
|
||||||
}
|
}
|
||||||
|
|
||||||
var _tabTemplate = _.template('<li class="ribtab"><div class="tab-bg" /><a href="#" data-tab="<%= action %>" data-title="<%= caption %>"><%= caption %></a></li>');
|
var _tabTemplate = _.template('<li class="ribtab" style="display: none;"><div class="tab-bg" /><a href="#" data-tab="<%= action %>" data-title="<%= caption %>"><%= caption %></a></li>');
|
||||||
|
|
||||||
config.tabs[after + 1] = tab;
|
config.tabs[after + 1] = tab;
|
||||||
var _after_action = _get_tab_action(after);
|
var _after_action = _get_tab_action(after);
|
||||||
|
@ -315,6 +319,11 @@ define([
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
setVisible: function (tab, visible) {
|
||||||
|
if ( tab && this.$tabs )
|
||||||
|
this.$tabs.find('> a[data-tab=' + tab + ']').parent().css('display', visible ? '' : 'none');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}()));
|
}()));
|
||||||
|
|
|
@ -57,6 +57,8 @@ define([
|
||||||
this.addListeners({
|
this.addListeners({
|
||||||
'Toolbar': {
|
'Toolbar': {
|
||||||
'render:before' : function (toolbar) {
|
'render:before' : function (toolbar) {
|
||||||
|
me.toolbar = toolbar;
|
||||||
|
|
||||||
var appOptions = me.getApplication().getController('Main').appOptions;
|
var appOptions = me.getApplication().getController('Main').appOptions;
|
||||||
|
|
||||||
if ( appOptions.isEdit && !appOptions.isEditMailMerge && !appOptions.isEditDiagram ) {
|
if ( appOptions.isEdit && !appOptions.isEditMailMerge && !appOptions.isEditDiagram ) {
|
||||||
|
@ -173,6 +175,8 @@ define([
|
||||||
arr.push(plugin);
|
arr.push(plugin);
|
||||||
});
|
});
|
||||||
this.api.asc_pluginsRegister('', arr);
|
this.api.asc_pluginsRegister('', arr);
|
||||||
|
if (this.toolbar && storePlugins.length>0)
|
||||||
|
this.toolbar.setVisible('plugins', true);
|
||||||
},
|
},
|
||||||
|
|
||||||
onAddPlugin: function (model) {
|
onAddPlugin: function (model) {
|
||||||
|
|
|
@ -662,6 +662,8 @@ define([
|
||||||
me.btnDocLang.updateHint(me.tipSetDocLang);
|
me.btnDocLang.updateHint(me.tipSetDocLang);
|
||||||
me.btnSetSpelling.updateHint(me.tipSetSpelling);
|
me.btnSetSpelling.updateHint(me.tipSetSpelling);
|
||||||
|
|
||||||
|
Common.NotificationCenter.trigger('tab:visible', 'review', true);
|
||||||
|
|
||||||
setEvents.call(me);
|
setEvents.call(me);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue