From 23ea9d0698a07dabc1a0824c16a306192410211d Mon Sep 17 00:00:00 2001 From: Ruud Date: Sat, 14 Jan 2012 12:27:43 +0100 Subject: [PATCH] Don't show delete button on new quality profiles --- couchpotato/core/plugins/profile/static/profile.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/couchpotato/core/plugins/profile/static/profile.js b/couchpotato/core/plugins/profile/static/profile.js index 7f35b019..60ac4f0b 100644 --- a/couchpotato/core/plugins/profile/static/profile.js +++ b/couchpotato/core/plugins/profile/static/profile.js @@ -24,7 +24,7 @@ var Profile = new Class({ var data = self.data; self.el = new Element('div.profile').adopt( - new Element('span.delete.icon', { + self.delete_button = new Element('span.delete.icon', { 'events': { 'click': self.del.bind(self) } @@ -58,6 +58,8 @@ var Profile = new Class({ if(data.types) Object.each(data.types, self.addType.bind(self)) + else + self.delete_button.hide(); self.addType(); }, @@ -71,7 +73,10 @@ var Profile = new Class({ self.addType(); var data = self.getData(); - if(data.types.length < 2) return; + if(data.types.length < 2) + return; + else + self.delete_button.show(); Api.request('profile.save', { 'data': self.getData(),