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

Fix appearrence of switch node port label for flow/global ref. (#1793)

* fix appearrence of switch node port label for flow/global ref

* use RED.utils.parseContextKey
This commit is contained in:
Hiroyasu Nishiyama 2018-07-10 20:40:52 +09:00 committed by Nick O'Leary
parent 6e9fe3248a
commit 407e16e900

View File

@ -99,11 +99,17 @@
}
return v;
}
function prop2name(key) {
var result = RED.utils.parseContextKey(key);
return result.key;
}
function getValueLabel(t,v) {
if (t === 'str') {
return '"'+clipValueLength(v)+'"';
} else if (t === 'msg' || t==='flow' || t==='global') {
} else if (t === 'msg') {
return t+"."+clipValueLength(v);
} else if (t === 'flow' || t === 'global') {
return t+"."+clipValueLength(prop2name(v));
}
return clipValueLength(v);
}