1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Support category with more than one word (#1301)

This commit is contained in:
Chaya Stern 2017-06-28 16:27:54 +03:00 committed by Nick O'Leary
parent 23539ee907
commit a780d4463c

View File

@ -22,7 +22,7 @@ RED.palette = (function() {
var categoryContainers = {};
function createCategoryContainer(category, label){
label = label || category.replace("_", " ");
label = (label || category).replace(/_/g, " ");
var catDiv = $('<div id="palette-container-'+category+'" class="palette-category palette-close hide">'+
'<div id="palette-header-'+category+'" class="palette-header"><i class="expanded fa fa-angle-down"></i><span>'+label+'</span></div>'+
'<div class="palette-content" id="palette-base-category-'+category+'">'+
@ -127,7 +127,7 @@ RED.palette = (function() {
}
if (exclusion.indexOf(def.category)===-1) {
var category = def.category.replace(" ","_");
var category = def.category.replace(/ /g,"_");
var rootCategory = category.split("-")[0];
var d = document.createElement("div");