Fix bug with plugin groups (don't separate groups without plugins)
This commit is contained in:
parent
902f5d2f5f
commit
14426a4b04
|
@ -195,19 +195,22 @@ define([
|
||||||
me.$toolbarPanelPlugins.empty();
|
me.$toolbarPanelPlugins.empty();
|
||||||
|
|
||||||
var _group = $('<div class="group"></div>'),
|
var _group = $('<div class="group"></div>'),
|
||||||
rank = -1;
|
rank = -1,
|
||||||
|
rank_plugins = 0;
|
||||||
collection.each(function (model) {
|
collection.each(function (model) {
|
||||||
var new_rank = model.get('groupRank');
|
var new_rank = model.get('groupRank');
|
||||||
if (new_rank!==rank && rank>-1) {
|
if (new_rank!==rank && rank>-1 && rank_plugins>0) {
|
||||||
_group.appendTo(me.$toolbarPanelPlugins);
|
_group.appendTo(me.$toolbarPanelPlugins);
|
||||||
$('<div class="separator long"></div>').appendTo(me.$toolbarPanelPlugins);
|
$('<div class="separator long"></div>').appendTo(me.$toolbarPanelPlugins);
|
||||||
_group = $('<div class="group"></div>');
|
_group = $('<div class="group"></div>');
|
||||||
|
rank_plugins = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
var btn = me.panelPlugins.createPluginButton(model);
|
var btn = me.panelPlugins.createPluginButton(model);
|
||||||
if (btn) {
|
if (btn) {
|
||||||
var $slot = $('<span class="slot"></span>').appendTo(_group);
|
var $slot = $('<span class="slot"></span>').appendTo(_group);
|
||||||
btn.render($slot);
|
btn.render($slot);
|
||||||
|
rank_plugins++;
|
||||||
}
|
}
|
||||||
rank = new_rank;
|
rank = new_rank;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue