From 5c2539334cd1bcfa72a04675108bbfbe8c83b3c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Fri, 19 Aug 2022 20:05:52 +0100 Subject: [PATCH] CustomCategory: add a close button --- lang/en.json | 1 + src/customCategory.js | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/lang/en.json b/lang/en.json index 34072f7c..e85808d5 100644 --- a/lang/en.json +++ b/lang/en.json @@ -6,6 +6,7 @@ "cancel": "Cancel", "categories": "Categories", "category-info-tooltip": "Info & Map key", + "close": "Close", "closed": "closed", "default": "default", "apply": "Apply", diff --git a/src/customCategory.js b/src/customCategory.js index 2fe6fc7b..3e9f4b02 100644 --- a/src/customCategory.js +++ b/src/customCategory.js @@ -117,6 +117,12 @@ class CustomCategoryEditor { input.value = lang('apply') controls.appendChild(input) + const inputClose = document.createElement('input') + inputClose.type = 'button' + inputClose.value = lang('close') + inputClose.onclick = () => this.window.close() + controls.appendChild(inputClose) + const tutorial = document.createElement('span') tutorial.className = 'tip-tutorial' let text = lang('tip-tutorial')