|
|
|
@ -82,19 +82,23 @@ module.exports = Marionette.Layout.extend({
|
|
|
|
|
this.filesCollection.add(file);
|
|
|
|
|
//this.listenTo(this.releaseCollection, 'sync', this._showSearchResults);
|
|
|
|
|
this.listenTo(this.model, 'change', function(model, options) {
|
|
|
|
|
if (options && options.changeSource === 'signalr') {
|
|
|
|
|
this._refresh(movie);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if (options && options.changeSource === 'signalr') {
|
|
|
|
|
this._refresh(model);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
vent.on(vent.Commands.CloseModalCommand, this._refreshClose, this);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
_refresh : function(movie) {
|
|
|
|
|
this.filesCollection = new FilesCollection();
|
|
|
|
|
var file = movie.model.get("movieFile");
|
|
|
|
|
this.filesCollection.add(file);
|
|
|
|
|
this.onShow();
|
|
|
|
|
_refresh : function(model) {
|
|
|
|
|
this.filesCollection = new FilesCollection();
|
|
|
|
|
|
|
|
|
|
if(model.get('hasFile')) {
|
|
|
|
|
var file = model.get("movieFile");
|
|
|
|
|
this.filesCollection.add(file);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.onShow();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
_refreshClose : function(options) {
|
|
|
|
@ -105,12 +109,12 @@ module.exports = Marionette.Layout.extend({
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onShow : function() {
|
|
|
|
|
this.grid.show(new Backgrid.Grid({
|
|
|
|
|
row : Backgrid.Row,
|
|
|
|
|
columns : this.columns,
|
|
|
|
|
collection : this.filesCollection,
|
|
|
|
|
className : 'table table-hover'
|
|
|
|
|
}));
|
|
|
|
|
this.grid.show(new Backgrid.Grid({
|
|
|
|
|
row : Backgrid.Row,
|
|
|
|
|
columns : this.columns,
|
|
|
|
|
collection : this.filesCollection,
|
|
|
|
|
className : 'table table-hover'
|
|
|
|
|
}));
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
_showMainView : function() {
|
|
|
|
|