From a780d4463c4910b5b8ce51fa3dff6e97f68fcc36 Mon Sep 17 00:00:00 2001 From: Chaya Stern Date: Wed, 28 Jun 2017 16:27:54 +0300 Subject: [PATCH] Support category with more than one word (#1301) --- editor/js/ui/palette.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editor/js/ui/palette.js b/editor/js/ui/palette.js index c40b3660f..b19190a3a 100644 --- a/editor/js/ui/palette.js +++ b/editor/js/ui/palette.js @@ -22,7 +22,7 @@ RED.palette = (function() { var categoryContainers = {}; function createCategoryContainer(category, label){ - label = label || category.replace("_", " "); + label = (label || category).replace(/_/g, " "); var catDiv = $('
'+ '
'+label+'
'+ '
'+ @@ -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");