0
0
mirror of https://github.com/Doodle3D/doodle3d-connect.git synced 2024-12-25 18:13:48 +01:00

Use pagebeforehide to stop processes earlier

This commit is contained in:
peteruithoven 2014-05-12 14:53:01 +02:00
parent 1835a0275f
commit 427b8f309d
5 changed files with 4 additions and 7 deletions

View File

@ -52,7 +52,7 @@
_networkAPI.init(boxURL); _networkAPI.init(boxURL);
retrieveNetworkStatus(); retrieveNetworkStatus();
}); });
$.mobile.document.on( "pagehide", PAGE_ID, function( event, data ) { $.mobile.document.on( "pagebeforehide", PAGE_ID, function( event, data ) {
clearTimeout(_retryRetrieveStatusDelay); clearTimeout(_retryRetrieveStatusDelay);
}); });

View File

@ -42,7 +42,7 @@
maxDisplayCount: 0 // do not obey the max display count maxDisplayCount: 0 // do not obey the max display count
}*/); }*/);
}); });
$.mobile.document.on( "pagehide", PAGE_ID, function( event, data ) { $.mobile.document.on( "pagebeforehide", PAGE_ID, function( event, data ) {
//console.log("Boxes page pagehide"); //console.log("Boxes page pagehide");
_connectAPI.stop(); _connectAPI.stop();
}); });

View File

@ -52,7 +52,7 @@
_networkAPI.startAutoRefresh(); _networkAPI.startAutoRefresh();
}); });
}); });
$.mobile.document.on( "pagehide", PAGE_ID, function( event, data ) { $.mobile.document.on( "pagebeforehide", PAGE_ID, function( event, data ) {
console.log("Connecting to network page pagehide"); console.log("Connecting to network page pagehide");
_networkAPI.stopAutoRefresh(); _networkAPI.stopAutoRefresh();
_connectAPI.stop(); _connectAPI.stop();

View File

@ -35,7 +35,7 @@
_networkAPI.init(boxURL); _networkAPI.init(boxURL);
refreshNetworks(); refreshNetworks();
}); });
$.mobile.document.on( "pagehide", PAGE_ID, function( event, data ) { $.mobile.document.on( "pagebeforehide", PAGE_ID, function( event, data ) {
console.log("Join network page pagehide"); console.log("Join network page pagehide");
clearTimeout(_refreshDelay); clearTimeout(_refreshDelay);
}); });

View File

@ -42,9 +42,6 @@
}); });
$.mobile.document.on( "pageshow", PAGE_ID, function( event, data ) { $.mobile.document.on( "pageshow", PAGE_ID, function( event, data ) {
d3d.util.autofocus(_form); d3d.util.autofocus(_form);
});
$.mobile.document.on( "pagehide", PAGE_ID, function( event, data ) {
console.log(PAGE_ID+" pagehide");
}); });
function join(){ function join(){
console.log("JoinSecuredNetworkPage:submit"); console.log("JoinSecuredNetworkPage:submit");