Fix whitelist item expando behaviour

This commit is contained in:
hensm
2022-08-08 19:34:26 +01:00
parent 59a433c597
commit 2d954e9a5e
2 changed files with 14 additions and 3 deletions

View File

@@ -337,9 +337,13 @@
"message": "Remove",
"description": "Tooltip text for whitelist item's remove button."
},
"optionsSiteWhitelistExpandItem": {
"optionsSiteWhitelistItemShowOptions": {
"message": "Show options",
"description": "Tooltip text for whitelist item's expand button."
"description": "Tooltip text for whitelist item's show options button."
},
"optionsSiteWhitelistItemHideOptions": {
"message": "Hide options",
"description": "Tooltip text for whitelist item's hide options button."
},
"optionsSiteWhitelistInvalidDuplicatePattern": {
"message": "Match pattern already exists!",

View File

@@ -111,6 +111,9 @@
isEditing = false;
}
expandedItemIndices.delete(index);
expandedItemIndices = expandedItemIndices;
items.splice(index, 1);
items = items;
}
@@ -184,7 +187,11 @@
<button
type="button"
class="whitelist__expand-button ghost"
title={_("optionsSiteWhitelistExpandItem")}
title={_(
isItemExpanded
? "optionsSiteWhitelistItemHideOptions"
: "optionsSiteWhitelistItemShowOptions"
)}
on:click={() => {
// Toggle expanded state
if (isItemExpanded) {