From 63c16be86d85593cc4d8ae7e54645756dcc40e1d Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Sat, 20 Jan 2024 00:52:53 -0500 Subject: [PATCH] remove the auto-created menu from the DOM after it disappears, to save memory --- lib/phast/client/scripts/controls/Menu.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/phast/client/scripts/controls/Menu.js b/lib/phast/client/scripts/controls/Menu.js index f654c15..bbe0583 100644 --- a/lib/phast/client/scripts/controls/Menu.js +++ b/lib/phast/client/scripts/controls/Menu.js @@ -66,6 +66,13 @@ function ContextMenu() e.stopPropagation(); return false; }); + elem.addEventListener("transitionend", function(e) + { + if (!System.ClassList.Contains(this, "uwt-visible")) + { + this.remove(); + } + }); for (var i = 0; i < this.Items.length; i++) {