From 4f89d5e8f1bfb041b23b026579763119fa73ab0e Mon Sep 17 00:00:00 2001 From: dcore94 Date: Wed, 21 Jun 2023 15:27:42 +0200 Subject: [PATCH] reuse return from save operation to switch to updatable form --- ccp/js/methodeditorcontroller.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ccp/js/methodeditorcontroller.js b/ccp/js/methodeditorcontroller.js index b340c0a..e534c30 100644 --- a/ccp/js/methodeditorcontroller.js +++ b/ccp/js/methodeditorcontroller.js @@ -205,10 +205,13 @@ class CCPMethodEditorController extends HTMLElement{ return resp.text() }else throw "Error saving process: " + resp.status }).then(data=>{ - this.unlockRender() if(!this.#isupdate){ - this.editMethod(this.#current.id) + this.#current = data + this.#isupdate = true + this.#tmp_inputs = Object.keys(this.#current.inputs).map(k=>this.#current.inputs[k]) + this.#tmp_outputs = Object.keys(this.#current.outputs).map(k=>this.#current.outputs[k]) } + this.unlockRender() }).catch(err=>{ alert(err) this.unlockRender() @@ -353,7 +356,7 @@ class CCPMethodEditorController extends HTMLElement{ this.#rootdoc.querySelector(".plexiglass").classList.toggle("d-none") this.render() this.#locked = false - this.parentElement.scrollIntoViewIfNeeded() + if(this.parentElement) this.parentElement.scrollIntoViewIfNeeded(); } render(){