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:
parent
23539ee907
commit
a780d4463c
@ -22,7 +22,7 @@ RED.palette = (function() {
|
|||||||
var categoryContainers = {};
|
var categoryContainers = {};
|
||||||
|
|
||||||
function createCategoryContainer(category, label){
|
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">'+
|
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 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+'">'+
|
'<div class="palette-content" id="palette-base-category-'+category+'">'+
|
||||||
@ -127,7 +127,7 @@ RED.palette = (function() {
|
|||||||
}
|
}
|
||||||
if (exclusion.indexOf(def.category)===-1) {
|
if (exclusion.indexOf(def.category)===-1) {
|
||||||
|
|
||||||
var category = def.category.replace(" ","_");
|
var category = def.category.replace(/ /g,"_");
|
||||||
var rootCategory = category.split("-")[0];
|
var rootCategory = category.split("-")[0];
|
||||||
|
|
||||||
var d = document.createElement("div");
|
var d = document.createElement("div");
|
||||||
|
Loading…
Reference in New Issue
Block a user