mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 14:54:37 +00:00
added support for onResourceRenamed
This commit is contained in:
@@ -652,16 +652,23 @@ LGraph.prototype.getElapsedTime = function()
|
||||
/**
|
||||
* Sends an event to all the nodes, useful to trigger stuff
|
||||
* @method sendEventToAllNodes
|
||||
* @param {String} eventname the name of the event
|
||||
* @param {Object} param an object containing the info
|
||||
* @param {String} eventname the name of the event (function to be called)
|
||||
* @param {Array} params parameters in array format
|
||||
*/
|
||||
|
||||
LGraph.prototype.sendEventToAllNodes = function(eventname, param)
|
||||
LGraph.prototype.sendEventToAllNodes = function(eventname, params)
|
||||
{
|
||||
var M = this._nodes_in_order ? this._nodes_in_order : this._nodes;
|
||||
for(var j in M)
|
||||
if(M[j][eventname])
|
||||
M[j][eventname](param);
|
||||
{
|
||||
if(params === undefined)
|
||||
M[j][eventname]();
|
||||
else if(params && params.constructor === Array)
|
||||
M[j][eventname].apply(M[j], params);
|
||||
else
|
||||
M[j][eventname](params);
|
||||
}
|
||||
}
|
||||
|
||||
LGraph.prototype.sendActionToCanvas = function(action, params)
|
||||
@@ -2059,8 +2066,6 @@ LGraphNode.prototype.captureInput = function(v)
|
||||
|
||||
//change
|
||||
c.node_capturing_input = v ? this : null;
|
||||
if(this.graph.debug)
|
||||
console.log(this.title + ": Capturing input " + (v?"ON":"OFF"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2367,7 +2372,7 @@ LGraphCanvas.prototype.setCanvas = function(canvas)
|
||||
|
||||
//read data
|
||||
var type = file.type.split("/")[0];
|
||||
if(type == "text")
|
||||
if(type == "text" || type == "")
|
||||
reader.readAsText(file);
|
||||
else if (type == "image")
|
||||
reader.readAsDataURL(file);
|
||||
@@ -2831,7 +2836,7 @@ LGraphCanvas.prototype.processMouseMove = function(e)
|
||||
*/
|
||||
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
//e.stopPropagation();
|
||||
return false;
|
||||
//this is not really optimal
|
||||
//this.graph.change();
|
||||
|
||||
Reference in New Issue
Block a user