Improve applicationCache management

This commit is contained in:
Benjamin Renard 2016-09-12 23:18:27 +02:00
parent 045cc25755
commit da6aab0146

View file

@ -1082,10 +1082,15 @@ $( document ).ready( function() {
view_home(); view_home();
pleaseWaitHide(); pleaseWaitHide();
$('#update_app').bind('click',updateApp); if (window.applicationCache.status==window.applicationCache.UNCACHED) {
window.applicationCache.addEventListener('updateready', onUpdateReady); $('#update_app').parent().remove();
window.applicationCache.addEventListener('noupdate', onNoUpdate); }
if(window.applicationCache.status === window.applicationCache.UPDATEREADY) { else {
onUpdateReady(); $('#update_app').bind('click',updateApp);
window.applicationCache.addEventListener('updateready', onUpdateReady);
window.applicationCache.addEventListener('noupdate', onNoUpdate);
if(window.applicationCache.status === window.applicationCache.UPDATEREADY) {
onUpdateReady();
}
} }
} ); } );