From c8938108c3334d4f24ecf864bada4c00f532ca7f Mon Sep 17 00:00:00 2001 From: dcore94 Date: Thu, 6 Apr 2023 17:25:33 +0200 Subject: [PATCH] add category hints from methodlist --- ccp/js/methodeditorcontroller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ccp/js/methodeditorcontroller.js b/ccp/js/methodeditorcontroller.js index e82bd1b..f557a23 100644 --- a/ccp/js/methodeditorcontroller.js +++ b/ccp/js/methodeditorcontroller.js @@ -597,8 +597,8 @@ class CCPMethodEditorController extends HTMLElement{ ev.preventDefault() ev.stopPropagation() if(ev.target.getAttribute('name') === "delete-category"){ - const index = ev.target.getAttribute("data-index") - this.#current.metadata.filter(md=>md.role === "category").splice(index, 1) + const val = ev.target.parentElement.title + this.#current.metadata = this.#current.metadata.filter(md=>md.role !== "category" || md.title !== val) this.reRenderCategories() this.#rootdoc.querySelector("input[name=category-input]").focus() }