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", "message": "Remove",
"description": "Tooltip text for whitelist item's remove button." "description": "Tooltip text for whitelist item's remove button."
}, },
"optionsSiteWhitelistExpandItem": { "optionsSiteWhitelistItemShowOptions": {
"message": "Show options", "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": { "optionsSiteWhitelistInvalidDuplicatePattern": {
"message": "Match pattern already exists!", "message": "Match pattern already exists!",

View File

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