From 04c4d69661df765cc0f0759004560590c05061e7 Mon Sep 17 00:00:00 2001 From: Ruud Date: Sun, 8 Jan 2012 23:26:27 +0100 Subject: [PATCH] Show manage movies only once --- couchpotato/static/scripts/page/manage.js | 24 ++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/couchpotato/static/scripts/page/manage.js b/couchpotato/static/scripts/page/manage.js index 8693ec00..ae874565 100644 --- a/couchpotato/static/scripts/page/manage.js +++ b/couchpotato/static/scripts/page/manage.js @@ -8,18 +8,20 @@ Page.Manage = new Class({ indexAction: function(param){ var self = this; - self.refresh_button = new Element('a.icon.refresh', { - 'text': 'Refresh', - 'events':{ - 'click': self.refresh.bind(self) - } - }).inject(self.el); + if(!self.list){ + self.refresh_button = new Element('a.icon.refresh', { + 'text': 'Refresh', + 'events':{ + 'click': self.refresh.bind(self) + } + }).inject(self.el); - self.list = new MovieList({ - 'status': 'done', - 'actions': MovieActions - }); - $(self.list).inject(self.el); + self.list = new MovieList({ + 'status': 'done', + 'actions': MovieActions + }); + $(self.list).inject(self.el); + } },