mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Allow notifications to be reused in place rather than stack
For example, clipboard actions now reuse the same notification. Similarly the Inject node will reuse its notification when injecting.
This commit is contained in:
@@ -483,20 +483,17 @@
|
||||
var key = RED.utils.parseContextKey(payload);
|
||||
payload = this.payloadType+"."+key.key;
|
||||
}
|
||||
var label = (this.name||payload);
|
||||
var label = this._def.label.call(this);
|
||||
if (label.length > 30) {
|
||||
label = label.substring(0,50)+"...";
|
||||
}
|
||||
label = label.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");
|
||||
|
||||
if (this.payloadType === "date") { label = this._("inject.timestamp"); }
|
||||
if (this.payloadType === "none") { label = this._("inject.blank"); }
|
||||
var node = this;
|
||||
$.ajax({
|
||||
url: "inject/"+this.id,
|
||||
type:"POST",
|
||||
success: function(resp) {
|
||||
RED.notify(node._("inject.success",{label:label}),"success");
|
||||
RED.notify(node._("inject.success",{label:label}),{type:"success",id:"inject"});
|
||||
},
|
||||
error: function(jqXHR,textStatus,errorThrown) {
|
||||
if (jqXHR.status == 404) {
|
||||
|
Reference in New Issue
Block a user