From eafc41ed7356ba1536e90a7ee599090ea1a9e044 Mon Sep 17 00:00:00 2001 From: tritant Date: Tue, 23 Sep 2025 13:32:25 +0200 Subject: [PATCH] Add files via upload --- js/orchestratormuter.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/js/orchestratormuter.js b/js/orchestratormuter.js index a316e33..17dedb2 100644 --- a/js/orchestratormuter.js +++ b/js/orchestratormuter.js @@ -41,11 +41,22 @@ app.registerExtension({ const onNodeCreated = nodeType.prototype.onNodeCreated; nodeType.prototype.onNodeCreated = function () { onNodeCreated?.apply(this, arguments); - - // --- NEW LOGIC TO CREATE TOGGLES --- + if (!this.widgets) { + this.widgets = []; + } + const topSpacer = { + name: "top_spacer", + type: "CUSTOM_SPACER", + draw: () => {}, + computeSize: () => [0, 25] // [largeur, hauteur] en pixels + }; + // Utilisez unshift pour l'ajouter en haut de la liste des widgets + this.widgets.push(topSpacer); // This function ensures only one toggle is active at a time. const handleToggleClick = (toggledWidgetName, isTurningOn) => { + + if (!isTurningOn) { // Prevent the user from turning off the last active toggle. const thisWidget = this.widgets.find(w => w.name === toggledWidgetName);