Update dashboard when the search ends of added new movie

This commit is contained in:
Ruud
2013-11-22 16:47:55 +01:00
parent 88d6148500
commit 99e641a30d
2 changed files with 14 additions and 0 deletions
@@ -65,6 +65,7 @@ var MovieList = new Class({
movie.destroy();
delete self.movies_added[notification.data.id];
self.setCounter(self.counter_count-1);
self.total_movies--;
}
})
}
@@ -75,6 +76,7 @@ var MovieList = new Class({
movieAdded: function(notification){
var self = this;
self.fireEvent('movieAdded', notification);
if(self.options.add_new && !self.movies_added[notification.data.id] && notification.data.status.identifier == self.options.status){
window.scroll(0,0);
self.createMovie(notification.data, 'top');
@@ -390,6 +392,7 @@ var MovieList = new Class({
self.movies.erase(movie);
movie.destroy();
self.setCounter(self.counter_count-1);
self.total_movies--;
});
self.calculateSelected();
+11
View File
@@ -57,6 +57,17 @@ Page.Home = new Class({
'limit': null,
'onLoaded': function(){
self.chain.callChain();
},
'onMovieAdded': function(notification){
// Track movie added
var after_search = function(data){
// Force update after search
self.available_list.update();
App.removeEvent('movie.searcher.ended.' + notification.data.id, after_search);
}
App.addEvent('movie.searcher.ended.' + notification.data.id, after_search);
}
});