From cd223c55a9fe278f77d376e047bb63b6534233e1 Mon Sep 17 00:00:00 2001 From: Yonatan Lifshitz Date: Fri, 13 Feb 2026 00:12:40 +0200 Subject: [PATCH] Added a popup before deleting a tab --- frontends/web/scripts/TabsController.js | 11 +++++++++-- frontends/web/scripts/main.js | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/frontends/web/scripts/TabsController.js b/frontends/web/scripts/TabsController.js index 17bf9c9..2cfc4fd 100644 --- a/frontends/web/scripts/TabsController.js +++ b/frontends/web/scripts/TabsController.js @@ -290,8 +290,15 @@ class TabsController { const contextMenuOpenedForTab = realThis.contextMenuOpenedForTab; realThis.contextMenuOpenedForTab = null; realThis.contextMenu.classList.remove("visible"); - - realThis.#removeTab(contextMenuOpenedForTab); + Swal.fire({ + title: "Remove tab", + text: `Are you sure you want to remove tab "${contextMenuOpenedForTab.name}"?`, + showCancelButton: true, + }).then(({ value = null }) => { + if (value != null) { + realThis.#removeTab(contextMenuOpenedForTab); + } + }); }; this.contextMenu.querySelector("#sources").onclick = function () { diff --git a/frontends/web/scripts/main.js b/frontends/web/scripts/main.js index 81b87cb..97be88a 100644 --- a/frontends/web/scripts/main.js +++ b/frontends/web/scripts/main.js @@ -513,7 +513,7 @@ function event_searchAll() { function event_removeCurrentTab() { Swal.fire({ title: "Remove tab", - text: "Are you sure you want to remove the current tab", + text: "Are you sure you want to remove the current tab?", showCancelButton: true, }).then(({ value = null }) => { if (value) {