Improve applicationCache management
This commit is contained in:
parent
045cc25755
commit
da6aab0146
1 changed files with 10 additions and 5 deletions
15
inc/myco.js
15
inc/myco.js
|
@ -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();
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
|
Loading…
Reference in a new issue