Hide plugins tab when no visible plugins (e.g., editor has only editing plugins but is opened in viewer mode)
This commit is contained in:
parent
faf3cceeea
commit
2e322cf66f
|
@ -49,6 +49,10 @@ define([
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
Common.Collections.Plugins = Backbone.Collection.extend({
|
Common.Collections.Plugins = Backbone.Collection.extend({
|
||||||
model: Common.Models.Plugin
|
model: Common.Models.Plugin,
|
||||||
|
|
||||||
|
hasVisible: function() {
|
||||||
|
return !!this.findWhere({visible: true});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -174,7 +174,7 @@ define([
|
||||||
arr.push(plugin);
|
arr.push(plugin);
|
||||||
});
|
});
|
||||||
this.api.asc_pluginsRegister('', arr);
|
this.api.asc_pluginsRegister('', arr);
|
||||||
if (storePlugins.length>0)
|
if (storePlugins.hasVisible())
|
||||||
Common.NotificationCenter.trigger('tab:visible', 'plugins', true);
|
Common.NotificationCenter.trigger('tab:visible', 'plugins', true);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue