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();
if (window.applicationCache.status==window.applicationCache.UNCACHED) {
$('#update_app').parent().remove();
}
else {
$('#update_app').bind('click',updateApp); $('#update_app').bind('click',updateApp);
window.applicationCache.addEventListener('updateready', onUpdateReady); window.applicationCache.addEventListener('updateready', onUpdateReady);
window.applicationCache.addEventListener('noupdate', onNoUpdate); window.applicationCache.addEventListener('noupdate', onNoUpdate);
if(window.applicationCache.status === window.applicationCache.UPDATEREADY) { if(window.applicationCache.status === window.applicationCache.UPDATEREADY) {
onUpdateReady(); onUpdateReady();
} }
}
} ); } );