Window unload event support for most browsers
* Also fixes "Webserver gone away" sometimes appearing on page reload
This commit is contained in:
parent
072eda70c4
commit
f20f27927d
|
@ -48,6 +48,8 @@
|
|||
// We catch resize events
|
||||
$(window).on('resize', { self: this }, this.onWindowResize);
|
||||
|
||||
$( window ).on('unload', { self: this }, this.onUnload);
|
||||
|
||||
// We catch scroll events in our containers
|
||||
$('.container').on('scroll', icinga.events.onContainerScroll);
|
||||
|
||||
|
@ -71,6 +73,13 @@
|
|||
// $(document).on('change', 'form.auto select', this.submitForm);
|
||||
},
|
||||
|
||||
onUnload: function(event)
|
||||
{
|
||||
var icinga = event.data.self.icinga;
|
||||
icinga.logger.info('Unloading Icinga');
|
||||
icinga.destroy();
|
||||
},
|
||||
|
||||
historyChanged: function(event)
|
||||
{
|
||||
var icinga = event.data.self.icinga;
|
||||
|
@ -228,6 +237,7 @@
|
|||
{
|
||||
$(window).off('popstate', this.historyChanged);
|
||||
$(window).off('resize', this.onWindowResize);
|
||||
$(window).off('unload', this.onUnload);
|
||||
$(document).off('scroll', '.container', this.onContainerScroll);
|
||||
$(document).off('click', 'a', this.linkClicked);
|
||||
$(document).off('click', 'tr[href]', this.linkClicked);
|
||||
|
|
Loading…
Reference in New Issue