Move check for updates to more menu
This commit is contained in:
@@ -67,6 +67,13 @@ var CouchPotato = new Class({
|
||||
self.block.footer = new Block.Footer(self, {})
|
||||
);
|
||||
|
||||
self.block.more.addLink(new Element('a', {
|
||||
'text': 'Check for updates',
|
||||
'events': {
|
||||
'click': self.checkForUpdate.bind(self)
|
||||
}
|
||||
}))
|
||||
|
||||
new ScrollSpy({
|
||||
min: 10,
|
||||
onLeave: function(){
|
||||
@@ -147,6 +154,15 @@ var CouchPotato = new Class({
|
||||
self.checkAvailable(1000);
|
||||
},
|
||||
|
||||
checkForUpdate: function(func){
|
||||
var self = this;
|
||||
|
||||
Updater.check(func)
|
||||
|
||||
self.blockPage('Please wait. If this takes to long, something must have gone wrong.', 'Checking for updates');
|
||||
self.checkAvailable(3000);
|
||||
},
|
||||
|
||||
checkAvailable: function(delay){
|
||||
var self = this;
|
||||
|
||||
|
||||
@@ -47,7 +47,9 @@ var AboutSettingTab = new Class({
|
||||
self.version_text = new Element('dd.version', {
|
||||
'text': 'Getting version...',
|
||||
'events': {
|
||||
'click': self.checkForUpdate.bind(self),
|
||||
'click': App.checkForUpdate.bind(App, function(json){
|
||||
self.fillVersion(json)
|
||||
}),
|
||||
'mouseenter': function(){
|
||||
this.set('text', 'Check for updates')
|
||||
},
|
||||
@@ -117,17 +119,6 @@ var AboutSettingTab = new Class({
|
||||
var self = this;
|
||||
var date = new Date(json.version.date * 1000);
|
||||
self.version_text.set('text', json.version.hash + ' ('+date.toUTCString()+')');
|
||||
},
|
||||
|
||||
checkForUpdate: function(){
|
||||
var self = this;
|
||||
|
||||
Updater.check(function(json){
|
||||
self.fillVersion(json)
|
||||
})
|
||||
|
||||
App.blockPage('Please wait. If this takes to long, something must have gone wrong.', 'Checking for updates');
|
||||
App.checkAvailable(3000);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -234,11 +234,11 @@ body > .spinner, .mask{
|
||||
margin-top: 20px;
|
||||
}
|
||||
.header .more_menu ul {
|
||||
width: 100px;
|
||||
margin-left: -60px;
|
||||
width: 150px;
|
||||
margin-left: -110px;
|
||||
}
|
||||
.header .more_menu ul:before {
|
||||
margin-left: -84px;
|
||||
margin-left: -34px;
|
||||
}
|
||||
|
||||
.header .more_menu .red { color: red; }
|
||||
|
||||
Reference in New Issue
Block a user