From 70783d3b603ff7d9c09c95da20467a710bdf6f85 Mon Sep 17 00:00:00 2001 From: Ruud Date: Mon, 5 Mar 2012 21:12:39 +0100 Subject: [PATCH] Move check for updates to more menu --- couchpotato/static/scripts/couchpotato.js | 16 ++++++++++++++++ couchpotato/static/scripts/page/about.js | 15 +++------------ couchpotato/static/style/main.css | 6 +++--- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/couchpotato/static/scripts/couchpotato.js b/couchpotato/static/scripts/couchpotato.js index 380d5fe..5d1c86d 100644 --- a/couchpotato/static/scripts/couchpotato.js +++ b/couchpotato/static/scripts/couchpotato.js @@ -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; diff --git a/couchpotato/static/scripts/page/about.js b/couchpotato/static/scripts/page/about.js index 05e1332..ad0dd5b 100644 --- a/couchpotato/static/scripts/page/about.js +++ b/couchpotato/static/scripts/page/about.js @@ -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); } }); diff --git a/couchpotato/static/style/main.css b/couchpotato/static/style/main.css index e582622..a46d9c3 100644 --- a/couchpotato/static/style/main.css +++ b/couchpotato/static/style/main.css @@ -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; }