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{ +