From: Thomas Berezansky Date: Wed, 19 Nov 2014 16:03:23 +0000 (-0500) Subject: Stop panel children before removing them X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Ftsbere%2Fstop_before_remove;p=working%2FEvergreen.git Stop panel children before removing them Helps reduce some "javascript still running" errors. But not all. Signed-off-by: Thomas Berezansky --- diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu.js b/Open-ILS/xul/staff_client/chrome/content/main/menu.js index e5788c863b..056e3bd5c9 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/menu.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/menu.js @@ -2465,7 +2465,10 @@ commands: tab.setAttribute('id',unique_id); if (params.focus) tab.focus(); var panel = this.controller.view.panels.childNodes[ idx ]; - while ( panel.lastChild ) panel.removeChild( panel.lastChild ); + while ( panel.lastChild ) { + if (typeof panel.lastChild.webNavigation != 'undefined') panel.lastChild.webNavigation.stop(3); + panel.removeChild( panel.lastChild ); + } //We need to set tab.marc_edit_changed to false here, so if the user goes //back to the MARC edit tab from a newly retrieved record when they had //previously edited the record that used to be in the tab then