Expand palette category when first entry added

This commit is contained in:
Nick O'Leary 2015-03-28 21:46:27 +00:00
parent be46c419dc
commit cf0c2825eb
1 changed files with 9 additions and 0 deletions

View File

@ -186,6 +186,15 @@ RED.palette = (function() {
}
setLabel(nt,$(d),label);
var categoryNode = $("#palette-container-"+category);
if (categoryNode.find(".palette_node").length === 1) {
if (!categoryNode.find("i").hasClass("expanded")) {
categoryNode.find(".palette-content").slideToggle();
categoryNode.find("i").toggleClass("expanded");
}
}
}
}