From 49ef0ebc5c229fde7e92c292e1df687498c3484c Mon Sep 17 00:00:00 2001 From: justin tucker Date: Tue, 29 Oct 2024 14:38:59 -0700 Subject: [PATCH] adding double click run renaming --- .../RokuAutomationView/AutoRunsEditor.svelte | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/webviews/src/views/RokuAutomationView/AutoRunsEditor.svelte b/webviews/src/views/RokuAutomationView/AutoRunsEditor.svelte index a6d86dcd..cbdc108f 100644 --- a/webviews/src/views/RokuAutomationView/AutoRunsEditor.svelte +++ b/webviews/src/views/RokuAutomationView/AutoRunsEditor.svelte @@ -133,6 +133,22 @@ runs = newRunList; }; + const renameRun = (e) => { + const run = getRunFromEvent(e); + console.log(`Renaming run: ${run}`); + selectedRun = run; + + showRunNameDialog(selectedRun) + .then((runName) => { + runs.find((r) => r.name === run).name = runName; + runs = runs; + selectedRun = runName; + }) + .catch((e) => { + // do nothing + }); + }; + const addNewRun = () => { showRunNameDialog() .then((runName) => { @@ -351,6 +367,7 @@ }} use:draggable={run.name} on:click={selectRun} + on:dblclick={renameRun} title={run.name} id={run.name === selectedRun ? 'selected-tr' : ''}>