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

Handle at sign in module example path for UI import menu

This commit allows an example from an npm package that has
an org scoped name (which includes an @ character) to be abbreviated
properly in the import menu - i.e., showing 'myexample' for a package
name of '@myorg/node-red-contrib-myexample' rather than
'@myorg/node red-contrib-myexample'.
This commit is contained in:
Jeremy Barlow 2018-01-29 15:27:34 -08:00
parent 3938550ea8
commit 2d0264116c

View File

@ -38,7 +38,7 @@ RED.library = (function() {
li.className = "dropdown-submenu pull-left";
a = document.createElement("a");
a.href="#";
var label = i.replace(/^node-red-contrib-/,"").replace(/^node-red-node-/,"").replace(/-/," ").replace(/_/," ");
var label = i.replace(/^@.*\//,"").replace(/^node-red-contrib-/,"").replace(/^node-red-node-/,"").replace(/-/," ").replace(/_/," ");
a.innerHTML = label;
li.appendChild(a);
li.appendChild(buildMenu(data.d[i],root+(root!==""?"/":"")+i));