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