From cb42a00d958fe4bd0e159a9e32753b31d34cefea Mon Sep 17 00:00:00 2001 From: Holger Voormann Date: Mon, 9 Oct 2023 11:27:58 +0200 Subject: [PATCH] Modernized help UI prototype: Fix set scope still set after deletion Fix the issue that a set scope will still be shown as active after it has been deleted. --- ua/org.eclipse.help.webapp/m/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ua/org.eclipse.help.webapp/m/index.js b/ua/org.eclipse.help.webapp/m/index.js index 5052c1b7f49..9cc726b6091 100644 --- a/ua/org.eclipse.help.webapp/m/index.js +++ b/ua/org.eclipse.help.webapp/m/index.js @@ -350,6 +350,12 @@ }); } else { var deleteButton = createButton(scopesPage, '<%js:scopes_scope_delete_button_label%>', '<%js:scopes_scope_delete_button_description%>', function() { + + // if the scope to be deleted is set, unset it first + if (searchScope.level == SEARCH_SCOPE_LEVEL_CUSTOM && searchScope.customIndex == scopeNr) { + setSearchScope([SEARCH_SCOPE_LEVEL_ALL]); + } + doScopesOperation('remove&workingSet=' + encodeURIComponent(scopeName)); }); deleteButton.className = 'b br';