mirror of
https://github.com/node-red/node-red.git
synced 2025-12-27 07:31:07 +01:00
Merge pull request #5168 from GogoVega/truncate-topic-debug
Truncate topic of debug message and add tooltip
This commit is contained in:
@@ -536,10 +536,22 @@ RED.debug = (function() {
|
||||
e.stopPropagation();
|
||||
showMessageMenu(filterMessage,debugMessage,sourceNode&&sourceNode.id);
|
||||
});
|
||||
$('<span class="red-ui-debug-msg-topic">'+
|
||||
(o.topic?topic+' : ':'')+
|
||||
(o.property?'msg.'+property:'msg')+" : "+format+
|
||||
'</span>').appendTo(metaRow);
|
||||
const msgInfos = `${o.topic ? " : " : ""}msg${o.property ? "." + property : ""} : ${format}`
|
||||
const topicTruncated = RED.utils.truncateString((o.topic ? topic : ""), 120 - msgInfos.length);
|
||||
const topicElem = $('<span class="red-ui-debug-msg-topic">' + topicTruncated + msgInfos + '</span>').appendTo(metaRow);
|
||||
if (topic !== topicTruncated) {
|
||||
RED.popover.create({
|
||||
content: topic,
|
||||
delay: { show: 750, hide: 50 },
|
||||
direction: "bottom",
|
||||
interactive: true,
|
||||
maxWidth: 300,
|
||||
target: topicElem,
|
||||
trigger: "hover",
|
||||
tooltip: true,
|
||||
size: "small"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var atBottom = (sbc.scrollHeight-messageList.height()-sbc.scrollTop) < 5;
|
||||
|
||||
Reference in New Issue
Block a user