mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-16 16:58:35 +00:00
Merge pull request #1547 in FS/freeswitch from ~THEHUNMONKGROUP/freeswitch:bugfix/FS-11283-ios-doesn-t-support-beforeunload to master
* commit '954b2564b2e4582949825988f30dde3fb16d1347': FS-11283: iOS doesn't support beforeunload, use recommended pagehide for that platform
This commit is contained in:
commit
fc26aa9785
@ -2713,10 +2713,17 @@
|
|||||||
|
|
||||||
$.verto.unloadJobs = [];
|
$.verto.unloadJobs = [];
|
||||||
|
|
||||||
$(window).bind('beforeunload', function() {
|
var unloadEventName = 'beforeunload';
|
||||||
for (var f in $.verto.unloadJobs) {
|
// Hacks for Mobile Safari
|
||||||
$.verto.unloadJobs[f]();
|
var iOS = ['iPad', 'iPhone', 'iPod'].indexOf(navigator.platform) >= 0;
|
||||||
}
|
if (iOS) {
|
||||||
|
unloadEventName = 'pagehide';
|
||||||
|
}
|
||||||
|
|
||||||
|
$(window).bind(unloadEventName, function() {
|
||||||
|
for (var f in $.verto.unloadJobs) {
|
||||||
|
$.verto.unloadJobs[f]();
|
||||||
|
}
|
||||||
|
|
||||||
if ($.verto.haltClosure)
|
if ($.verto.haltClosure)
|
||||||
return $.verto.haltClosure();
|
return $.verto.haltClosure();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user