From e7095820629b27cccbbaf81a5509de2780a666b6 Mon Sep 17 00:00:00 2001 From: George O <16269580+Ge0rg3@users.noreply.github.com> Date: Mon, 10 Jun 2019 00:06:15 +0100 Subject: [PATCH] Disappearing Popover Fix --- src/web/RecipeWaiter.mjs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/web/RecipeWaiter.mjs b/src/web/RecipeWaiter.mjs index f2edd725..b8b523dc 100755 --- a/src/web/RecipeWaiter.mjs +++ b/src/web/RecipeWaiter.mjs @@ -124,16 +124,21 @@ class RecipeWaiter { * @param {event} evt */ opSortEnd(evt) { - if (this.removeIntent) { - if (evt.item.parentNode.id === "rec-list") { - evt.item.remove(); - } + if (this.removeIntent && evt.item.parentNode.id === "rec-list") { + evt.item.remove(); return; } // Reinitialise the popover on the original element in the ops list because for some reason it - // gets destroyed and recreated. - this.manager.ops.enableOpsListPopovers(evt.clone); + // gets destroyed and recreated. If the clone isn't in the ops list, we use the original item instead. + let enableOpsElement; + if (evt.clone.parentNode && evt.clone.parentNode.classList.contains("op-list")) { + enableOpsElement = evt.clone; + } else { + enableOpsElement = evt.item; + $(evt.item).attr("data-toggle", "popover"); + } + this.manager.ops.enableOpsListPopovers(enableOpsElement); if (evt.item.parentNode.id !== "rec-list") { return;