Better attempt at making Inject node label more "useful".

Addresses Issue #489
This commit is contained in:
Dave C-J 2014-11-16 18:22:33 +00:00
parent 7da108e129
commit 977a9e1c83
1 changed files with 10 additions and 8 deletions

View File

@ -138,15 +138,17 @@
icon: "inject.png",
label: function() {
if (this.payloadType === "string") {
return this.name||this.topic||this.payload||"inject";
//if (this.topic !== "") {
// return this.name||this.topic +" : "+this.payload||this.topic;
//}
//else {
// return this.name||this.payload||this.topic||"inject";
//}
if ((this.topic.length + this.payload.length) <= 32) {
return this.name||this.topic + ":" + this.payload;
}
else if (this.payload.length < 24) {
return this.name||":"+this.payload;
}
}
else { return this.name||this.topic||"inject"; }
if ((this.topic.length < 24) && (this.topic.length > 0)) {
return this.name||this.topic+":";
}
else { return this.name||(this.payloadType==="date"?"timestamp":null)||"inject"; }
},
labelStyle: function() {
return this.name?"node_label_italic":"";