From 0fce37cc739d88aa5019c13689f3e956a808f7c8 Mon Sep 17 00:00:00 2001 From: antelle Date: Sun, 27 Oct 2019 09:10:00 +0100 Subject: [PATCH] fix #1324: duplicated shortcut editor in settings --- app/scripts/views/settings/settings-shortcuts-view.js | 10 +++++++++- release-notes.md | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/scripts/views/settings/settings-shortcuts-view.js b/app/scripts/views/settings/settings-shortcuts-view.js index fa244811..ddfa3b54 100644 --- a/app/scripts/views/settings/settings-shortcuts-view.js +++ b/app/scripts/views/settings/settings-shortcuts-view.js @@ -53,7 +53,15 @@ class SettingsShortcutsView extends View { shortcutClick(e) { const globalShortcutType = e.target.dataset.shortcut; - const shortcutEditor = $('
').addClass('shortcut__editor'); + const existing = $(`.shortcut__editor[data-shortcut=${globalShortcutType}]`); + if (existing.length) { + existing.remove(); + return; + } + + const shortcutEditor = $('
') + .addClass('shortcut__editor') + .attr('data-shortcut', globalShortcutType); $('
') .text(Locale.setShEdit) .appendTo(shortcutEditor); diff --git a/release-notes.md b/release-notes.md index 0ba631cc..bfe05c11 100644 --- a/release-notes.md +++ b/release-notes.md @@ -1,5 +1,8 @@ Release notes ------------- +##### v1.12.1 (2019-10-27) +`-` fix #1324: duplicated shortcut editor in settings + ##### v1.12.0 (2019-10-26) `-` #1022: fuzzy search `+` #1108: setting for running in an iframe