Move check for updates to more menu

This commit is contained in:
Ruud committed 2012-03-05 21:12:39 +01:00
1 parent 59373b0793
commit 70783d3b60
3 files changed
+22 -15

No files matched your search

+16
View File
@@ -67,6 +67,13 @@ var CouchPotato = new Class({
self.block.footer = new Block.Footer(self, {}) 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({ new ScrollSpy({
min: 10, min: 10,
onLeave: function(){ onLeave: function(){
@@ -147,6 +154,15 @@ var CouchPotato = new Class({
self.checkAvailable(1000); 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){ checkAvailable: function(delay){
var self = this; var self = this;
+3 -12
View File
@@ -47,7 +47,9 @@ var AboutSettingTab = new Class({
self.version_text = new Element('dd.version', { self.version_text = new Element('dd.version', {
'text': 'Getting version...', 'text': 'Getting version...',
'events': { 'events': {
'click': self.checkForUpdate.bind(self), 'click': App.checkForUpdate.bind(App, function(json){
self.fillVersion(json)
}),
'mouseenter': function(){ 'mouseenter': function(){
this.set('text', 'Check for updates') this.set('text', 'Check for updates')
}, },
@@ -117,17 +119,6 @@ var AboutSettingTab = new Class({
var self = this; var self = this;
var date = new Date(json.version.date * 1000); var date = new Date(json.version.date * 1000);
self.version_text.set('text', json.version.hash + ' ('+date.toUTCString()+')'); 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);
} }
}); });
+3 -3
View File
@@ -234,11 +234,11 @@ body > .spinner, .mask{
margin-top: 20px; margin-top: 20px;
} }
.header .more_menu ul { .header .more_menu ul {
width: 100px; width: 150px;
margin-left: -60px; margin-left: -110px;
} }
.header .more_menu ul:before { .header .more_menu ul:before {
margin-left: -84px; margin-left: -34px;
} }
.header .more_menu .red { color: red; } .header .more_menu .red { color: red; }