mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Add debug message menu
This commit is contained in:
@@ -92,7 +92,8 @@ RED.menu = (function() {
|
||||
menuItems[opt.id] = opt;
|
||||
|
||||
if (opt.onselect) {
|
||||
link.click(function() {
|
||||
link.click(function(e) {
|
||||
e.preventDefault();
|
||||
if ($(this).parent().hasClass("disabled")) {
|
||||
return;
|
||||
}
|
||||
@@ -150,15 +151,13 @@ RED.menu = (function() {
|
||||
}
|
||||
function createMenu(options) {
|
||||
|
||||
var button = $("#"+options.id);
|
||||
var menuParent = $("#"+options.id);
|
||||
|
||||
//button.click(function(event) {
|
||||
// $("#"+options.id+"-submenu").show();
|
||||
// event.preventDefault();
|
||||
//});
|
||||
var topMenu = $("<ul/>",{id:options.id+"-submenu", class:"dropdown-menu pull-right"});
|
||||
|
||||
|
||||
var topMenu = $("<ul/>",{id:options.id+"-submenu", class:"dropdown-menu pull-right"}).insertAfter(button);
|
||||
if (menuParent.length === 1) {
|
||||
topMenu.insertAfter(menuParent);
|
||||
}
|
||||
|
||||
var lastAddedSeparator = false;
|
||||
for (var i=0;i<options.options.length;i++) {
|
||||
@@ -171,6 +170,8 @@ RED.menu = (function() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return topMenu;
|
||||
}
|
||||
|
||||
function triggerAction(id, args) {
|
||||
|
@@ -201,6 +201,9 @@ RED.utils = (function() {
|
||||
strippedKey = path.substring(rootPath.length+(path[rootPath.length]==="."?1:0));
|
||||
}
|
||||
var element = $('<span class="debug-message-element"></span>');
|
||||
element.collapse = function() {
|
||||
element.find(".debug-message-expandable").parent().addClass("collapsed");
|
||||
}
|
||||
header = $('<span class="debug-message-row"></span>').appendTo(element);
|
||||
if (sourceId) {
|
||||
addMessageControls(header,sourceId,path,obj,rootPath,strippedKey);
|
||||
@@ -224,6 +227,10 @@ RED.utils = (function() {
|
||||
}
|
||||
expandPaths.sort();
|
||||
}
|
||||
element.clearPinned = function() {
|
||||
element.find(".debug-message-row-pinned").removeClass("debug-message-row-pinned");
|
||||
pinnedPaths[sourceId] = {};
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!hideKey) {
|
||||
|
Reference in New Issue
Block a user