From ae7d679a6a96832893a1feb51013f88ba68d6f56 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 16 Apr 2015 21:01:08 +0200 Subject: [PATCH] Revert "Do not destroy all global on mailto link clicks" This reverts commit 16b9c73436bab9318d1a09f5caaba8412fd168c2. As I already mentioned, this re-introduces the problem that you'll get ugly "lost connection to web server" notifications. Easiest way to reproduce this: click your browsers reload button while a request is pending - or just click reload a couple of times while showing the dashboard. refs #7759 --- public/js/icinga/events.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/js/icinga/events.js b/public/js/icinga/events.js index 491ca82f2..7e87a8fb6 100644 --- a/public/js/icinga/events.js +++ b/public/js/icinga/events.js @@ -100,6 +100,7 @@ // Destroy Icinga, clean up and interrupt pending requests on unload $( window ).on('unload', { self: this }, this.onUnload); + $( window ).on('beforeunload', { self: this }, this.onUnload); // We catch scroll events in our containers $('.container').on('scroll', { self: this }, this.icinga.events.onContainerScroll); @@ -555,6 +556,7 @@ $(window).off('resize', this.onWindowResize); $(window).off('load', this.onLoad); $(window).off('unload', this.onUnload); + $(window).off('beforeunload', this.onUnload); $(document).off('scroll', '.container', this.onContainerScroll); $(document).off('click', 'a', this.linkClicked); $(document).off('click', 'table.action tr[href]', this.rowSelected);