Stop panel children before removing them user/tsbere/stop_before_remove
authorThomas Berezansky <tsbere@mvlc.org>
Wed, 19 Nov 2014 16:03:23 +0000 (11:03 -0500)
committerThomas Berezansky <tsbere@mvlc.org>
Wed, 19 Nov 2014 16:03:23 +0000 (11:03 -0500)
Helps reduce some "javascript still running" errors.

But not all.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Open-ILS/xul/staff_client/chrome/content/main/menu.js

index e5788c8..056e3bd 100644 (file)
@@ -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