From e69f25e8f319c95a4e98af5a1c1e2956bb4a9ae0 Mon Sep 17 00:00:00 2001 From: Ruud Date: Sat, 7 Apr 2012 20:27:54 +0200 Subject: [PATCH] Loading mask when adding movies --- .../core/plugins/movie/static/search.js | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/couchpotato/core/plugins/movie/static/search.js b/couchpotato/core/plugins/movie/static/search.js index a94b3438..53a8d399 100644 --- a/couchpotato/core/plugins/movie/static/search.js +++ b/couchpotato/core/plugins/movie/static/search.js @@ -285,6 +285,8 @@ Block.Search.Item = new Class({ var self = this; (e).preventDefault(); + self.loadingMask(); + Api.request('movie.add', { 'data': { 'identifier': self.info.imdb, @@ -358,6 +360,25 @@ Block.Search.Item = new Class({ }, + loadingMask: function(){ + var self = this; + + var s = self.options.getSize(); + + self.mask = new Element('span.mask', { + 'styles': { + 'width': s.x, + 'height': s.y + } + }).inject(self.options).fade('hide').position({ + 'relativeTo': self.options + }) + + createSpinner(self.mask) + self.mask.fade('in') + + }, + toElement: function(){ return this.el }