From 9e76716fd3b64ea4214371693ea1226ac61755ea Mon Sep 17 00:00:00 2001 From: William Troup Date: Mon, 18 Mar 2024 14:22:05 +0000 Subject: [PATCH] The "unload" window event has been replaced with "pagehide" (due to "unload" being deprecated). --- dist/heat.js | 2 +- dist/heat.min.js | 2 +- src/heat.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/heat.js b/dist/heat.js index 5e42efb7..14103797 100644 --- a/dist/heat.js +++ b/dist/heat.js @@ -2141,7 +2141,7 @@ _parameter_Document.addEventListener("DOMContentLoaded", function() { render(); }); - _parameter_Window.addEventListener("unload", function() { + _parameter_Window.addEventListener("pagehide", function() { cancelAllPullDataTimers(); }); if (!isDefined(_parameter_Window.$heat)) { diff --git a/dist/heat.min.js b/dist/heat.min.js index 9051810c..fad65b1c 100644 --- a/dist/heat.min.js +++ b/dist/heat.min.js @@ -70,4 +70,4 @@ k[a].options;c.currentView.year=b;S(c,c.currentView.year)?z(c):aa(c,!1);w(c.onSe a.currentView.year));return this};this.getYear=function(a){var b=null;q(a)&&k.hasOwnProperty(a)&&(b=k[a].options.currentView.year);return b};this.render=function(a,b){G(a)&&G(b)&&za(Aa(b,a));return this};this.renderAll=function(){ya();return this};this.switchView=function(a,b){if(q(a)&&q(b)&&k.hasOwnProperty(a)){var c=k[a].options,d=null;"map"===b.toLowerCase()?d=1:"chart"===b.toLowerCase()?d=2:"statistics"===b.toLowerCase()&&(d=3);la(d)&&(c.currentView.view=d,w(c.onViewSwitch,b),z(c,!1,!0))}return this}; this.switchType=function(a,b){if(q(a)&&q(b)&&k.hasOwnProperty(a)&&k[a].type.hasOwnProperty(b)){var c=k[a].options;c.currentView.type!==b&&(c.currentView.type=b,w(c.onTypeSwitch,b),z(c))}return this};this.updateOptions=function(a,b){if(q(a)&&G(b)&&k.hasOwnProperty(a)){var c=k[a].options,d=Ba(b),e=!1,f;for(f in d)d.hasOwnProperty(f)&&c.hasOwnProperty(f)&&c[f]!==d[f]&&(c[f]=d[f],e=!0);e&&(z(c,!0),w(c.onRefresh,c.currentView.element))}return this};this.destroyAll=function(){for(var a in k)k.hasOwnProperty(a)&& La(k[a].options);k={};return this};this.destroy=function(a){q(a)&&k.hasOwnProperty(a)&&(La(k[a].options),delete k[a]);return this};this.setConfiguration=function(a,b){if(G(a)){var c=!1,d;for(d in a)a.hasOwnProperty(d)&&h.hasOwnProperty(d)&&h[d]!==a[d]&&(h[d]=a[d],c=!0);c&&(b=n(b,!0),Ma(h),b&&this.refreshAll())}return this};this.getIds=function(){var a=[],b;for(b in k)k.hasOwnProperty(b)&&a.push(b);return a};this.getVersion=function(){return"2.7.2"};(function(a,b,c,d){F=a;B=b;J=c;ba=d;Ma();F.addEventListener("DOMContentLoaded", -function(){ya()});B.addEventListener("unload",function(){for(var e in k)if(k.hasOwnProperty(e)){var f=k[e].options;v(f.currentView.isInFetchModeTimer)&&clearInterval(f.currentView.isInFetchModeTimer)}});v(B.$heat)||(B.$heat=this)})(document,window,Math,JSON)})(); \ No newline at end of file +function(){ya()});B.addEventListener("pagehide",function(){for(var e in k)if(k.hasOwnProperty(e)){var f=k[e].options;v(f.currentView.isInFetchModeTimer)&&clearInterval(f.currentView.isInFetchModeTimer)}});v(B.$heat)||(B.$heat=this)})(document,window,Math,JSON)})(); \ No newline at end of file diff --git a/src/heat.js b/src/heat.js index 26388d8f..6c8e9583 100644 --- a/src/heat.js +++ b/src/heat.js @@ -3389,7 +3389,7 @@ render(); } ); - _parameter_Window.addEventListener( "unload", function() { + _parameter_Window.addEventListener( "pagehide", function() { cancelAllPullDataTimers(); } );