Always do restart after update. fix #363

This commit is contained in:
Ruud
2012-05-28 20:50:21 +02:00
parent b2ccca9299
commit 523a1e7d63
4 changed files with 57 additions and 24 deletions
+9 -6
View File
@@ -24,7 +24,7 @@ var CouchPotato = new Class({
if(window.location.hash)
History.handleInitialState();
self.openPage(window.location.pathname);
History.addEvent('change', self.openPage.bind(self));
@@ -211,10 +211,10 @@ var CouchPotato = new Class({
}]);
},
checkForUpdate: function(func){
checkForUpdate: function(onComplete){
var self = this;
Updater.check(func)
Updater.check(onComplete)
self.blockPage('Please wait. If this takes to long, something must have gone wrong.', 'Checking for updates');
self.checkAvailable(3000);
@@ -244,6 +244,8 @@ var CouchPotato = new Class({
blockPage: function(message, title){
var self = this;
self.unBlockPage();
var body = $(document.body);
self.mask = new Element('div.mask').adopt(
new Element('div').adopt(
@@ -259,9 +261,10 @@ var CouchPotato = new Class({
unBlockPage: function(){
var self = this;
self.mask.get('tween').start('opacity', 0).chain(function(){
this.element.destroy()
});
if(self.mask)
self.mask.get('tween').start('opacity', 0).chain(function(){
this.element.destroy()
});
},
createUrl: function(action, params){
+1 -1
View File
@@ -48,7 +48,7 @@ var AboutSettingTab = new Class({
'text': 'Getting version...',
'events': {
'click': App.checkForUpdate.bind(App, function(json){
self.fillVersion(json)
self.fillVersion(json.info)
}),
'mouseenter': function(){
this.set('text', 'Check for updates')