mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-22 19:29:54 +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,7 +2713,14 @@
|
|||||||
|
|
||||||
$.verto.unloadJobs = [];
|
$.verto.unloadJobs = [];
|
||||||
|
|
||||||
$(window).bind('beforeunload', function() {
|
var unloadEventName = 'beforeunload';
|
||||||
|
// Hacks for Mobile Safari
|
||||||
|
var iOS = ['iPad', 'iPhone', 'iPod'].indexOf(navigator.platform) >= 0;
|
||||||
|
if (iOS) {
|
||||||
|
unloadEventName = 'pagehide';
|
||||||
|
}
|
||||||
|
|
||||||
|
$(window).bind(unloadEventName, function() {
|
||||||
for (var f in $.verto.unloadJobs) {
|
for (var f in $.verto.unloadJobs) {
|
||||||
$.verto.unloadJobs[f]();
|
$.verto.unloadJobs[f]();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user