From 234d852742df3edb086cb7723b31cb996a3861e1 Mon Sep 17 00:00:00 2001 From: dcore94 Date: Fri, 17 Mar 2023 11:28:05 +0100 Subject: [PATCH] added click action also for edit --- ccp/js/methodeditorcontroller2.js | 19 +++++++++++++++++++ ccp/js/methodlistcontroller2.js | 20 ++++++++++++++++++-- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/ccp/js/methodeditorcontroller2.js b/ccp/js/methodeditorcontroller2.js index 50ce1df..7eac2c8 100644 --- a/ccp/js/methodeditorcontroller2.js +++ b/ccp/js/methodeditorcontroller2.js @@ -163,11 +163,30 @@ class CCPMethodEditorController extends HTMLElement{ this.#serviceurl = this.getAttribute("serviceurl") this.initMethod() this.fetchInfrastructures() + this.connectNewEditRequest() } connectedCallback(){ } + + connectNewEditRequest(){ + document.addEventListener("neweditrequest", ev=>{ + if(window.confirm("Confirm editing method?")){ + this.editMethod(ev.detail) + this.parentElement.scrollIntoViewIfNeeded() + } + }) + } + + connectNewCloneRequest(){ + document.addEventListener("newclonerequest", ev=>{ + if(window.confirm("Confirm cloning of method?")){ + this.cloneMethod(ev.detail) + this.parentElement.scrollIntoViewIfNeeded() + } + }) + } isInfrastructureRegistered(infra){ return (this.#infrastructures.filter(i=>i.id === infra.id)).length > 0 diff --git a/ccp/js/methodlistcontroller2.js b/ccp/js/methodlistcontroller2.js index a0d440d..e24b025 100644 --- a/ccp/js/methodlistcontroller2.js +++ b/ccp/js/methodlistcontroller2.js @@ -79,7 +79,7 @@ class CCPMethodList2 extends HTMLElement{ +