From b2431785349616aba9b3c9a4626ed5c089879c02 Mon Sep 17 00:00:00 2001 From: dcore94 Date: Fri, 17 Mar 2023 10:49:21 +0100 Subject: [PATCH] transform executable into action --- ccp/js/executionformcontroller.js | 10 ++++++++++ ccp/js/methodlistcontroller2.js | 16 ++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/ccp/js/executionformcontroller.js b/ccp/js/executionformcontroller.js index 050dee7..ca9658c 100644 --- a/ccp/js/executionformcontroller.js +++ b/ccp/js/executionformcontroller.js @@ -13,6 +13,8 @@ class CCPExecutionForm extends HTMLElement{ this.#boot = document.querySelector("d4s-boot-2") this.#serviceurl = this.getAttribute("serviceurl") this.#rootdoc = this.attachShadow({ "mode" : "open"}) + + this.connectNewExecutionRequest() this.render() this.showMethod() } @@ -28,6 +30,14 @@ class CCPExecutionForm extends HTMLElement{ } } + connectNewExecutionRequest(){ + document.addEventListener("newexecutionrequest", ev=>{ + if(window.confirm("Confirm overwrite of execution form?")){ + this.setAttribute("method", ev.detail) + } + }) + } + render(){ this.#rootdoc.innerHTML = `
diff --git a/ccp/js/methodlistcontroller2.js b/ccp/js/methodlistcontroller2.js index 4b1ff5f..a0d440d 100644 --- a/ccp/js/methodlistcontroller2.js +++ b/ccp/js/methodlistcontroller2.js @@ -88,11 +88,11 @@ class CCPMethodList2 extends HTMLElement{
-
- - +
+ @@ -326,8 +326,12 @@ class CCPMethodList2 extends HTMLElement{ target : "li.ccp-process", "in" : (e,d)=>this.#filtered[d], on_click : ev=>{ + const id = ev.currentTarget.bss_input.data.id if(ev.target.getAttribute("name") === "export_method"){ - this.exportMethod(ev.currentTarget.bss_input.data.id) + this.exportMethod(id) + }else if(ev.target.getAttribute("name") === "executable"){ + const event = new CustomEvent('newexecutionrequest', { detail: id }); + document.dispatchEvent(event) } }, on_dragstart : ev=>{ @@ -345,7 +349,7 @@ class CCPMethodList2 extends HTMLElement{ apply : (e,d)=>{ e.textContent = d.version } }, { - target: "div[name=executable]", + target: "button[name=executable]", apply : (e,d)=>{ e.style.display = d.executable ? "revert" : "none" } }, {