mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-09 01:20:09 +00:00
Add event when readonly changes (#160)
* Add even when readonly is changed * Swap to ts private instead of es
This commit is contained in:
1
public/litegraph.d.ts
vendored
1
public/litegraph.d.ts
vendored
@@ -1393,6 +1393,7 @@ export declare class LGraphCanvas {
|
||||
graph_mouse: Vector2;
|
||||
|
||||
pointer_is_down?: boolean;
|
||||
read_only: boolean;
|
||||
|
||||
/** clears all the data inside */
|
||||
clear(): void;
|
||||
|
||||
@@ -69,6 +69,21 @@ export class LGraphCanvas {
|
||||
}
|
||||
}
|
||||
|
||||
// if set to true users cannot modify the graph
|
||||
private _read_only = false;
|
||||
get read_only() {
|
||||
return this._read_only
|
||||
}
|
||||
set read_only(value) {
|
||||
if (value != this._read_only) {
|
||||
this._read_only = value;
|
||||
this.emitEvent({
|
||||
subType: "read-only",
|
||||
readOnly: value
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
constructor(canvas, graph, options) {
|
||||
this.options = options = options || {};
|
||||
|
||||
@@ -113,7 +128,6 @@ export class LGraphCanvas {
|
||||
this.clear_background = true;
|
||||
this.clear_background_color = "#222";
|
||||
|
||||
this.read_only = false; //if set to true users cannot modify the graph
|
||||
this.render_only_selected = true;
|
||||
this.live_mode = false;
|
||||
this.show_info = true;
|
||||
|
||||
Reference in New Issue
Block a user