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

Merge pull request #2314 from ThierryLeGal/addItem-insert-divider

Insert divider in menu by calling RED.menu.addItem('id', null);
This commit is contained in:
Nick O'Leary 2019-10-10 14:29:14 +01:00 committed by GitHub
commit bf65dcd49b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -244,7 +244,7 @@ RED.menu = (function() {
function addItem(id,opt) { function addItem(id,opt) {
var item = createMenuItem(opt); var item = createMenuItem(opt);
if (opt.group) { if (opt !== null && opt.group) {
var groupItems = $("#"+id+"-submenu").children(".red-ui-menu-group-"+opt.group); var groupItems = $("#"+id+"-submenu").children(".red-ui-menu-group-"+opt.group);
if (groupItems.length === 0) { if (groupItems.length === 0) {
item.appendTo("#"+id+"-submenu"); item.appendTo("#"+id+"-submenu");