parent
fbe9ad6582
commit
032bc2d5c4
@ -1,51 +1,47 @@
|
||||
var Marionette = require('marionette');
|
||||
var AddMoviesView = require('../AddMoviesView');
|
||||
var ListItemView = require('./ListItemView');
|
||||
var vent = require('vent');
|
||||
|
||||
module.exports = Marionette.CompositeView.extend({
|
||||
itemView : AddMoviesView,
|
||||
itemViewContainer : '.x-loading-folders',
|
||||
template : 'AddMovies/List/AddFromListCollectionViewTemplate',
|
||||
module.exports = Marionette.CollectionView.extend({
|
||||
itemView : ListItemView,
|
||||
|
||||
ui : {
|
||||
loadingFolders : '.x-loading-list'
|
||||
loadingList : '.x-loading-list'
|
||||
},
|
||||
|
||||
initialize : function() {
|
||||
this.collection = new UnmappedFolderCollection();
|
||||
this.collection.importItems(this.model);
|
||||
},
|
||||
|
||||
showCollection : function() {
|
||||
this._showAndSearch(0);
|
||||
},
|
||||
|
||||
appendHtml : function(collectionView, itemView, index) {
|
||||
collectionView.ui.loadingFolders.before(itemView.el);
|
||||
},
|
||||
|
||||
_showAndSearch : function(index) {
|
||||
var self = this;
|
||||
var model = this.collection.at(index);
|
||||
|
||||
if (model) {
|
||||
var currentIndex = index;
|
||||
var folderName = model.get('folder').name;
|
||||
this.addItemView(model, this.getItemView(), index);
|
||||
this.children.findByModel(model).search({ term : folderName }).always(function() {
|
||||
if (!self.isClosed) {
|
||||
self._showAndSearch(currentIndex + 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
else {
|
||||
this.ui.loadingFolders.hide();
|
||||
}
|
||||
showCollection : function() {
|
||||
},
|
||||
|
||||
itemViewOptions : {
|
||||
isExisting : true
|
||||
}
|
||||
//
|
||||
// appendHtml : function(collectionView, itemView, index) {
|
||||
// collectionView.ui.loadingFolders.before(itemView.el);
|
||||
// },
|
||||
//
|
||||
// _showAndSearch : function(index) {
|
||||
// var self = this;
|
||||
// var model = this.collection.at(index);
|
||||
//
|
||||
// if (model) {
|
||||
// var currentIndex = index;
|
||||
// var folderName = model.get('folder').name;
|
||||
// this.addItemView(model, this.getItemView(), index);
|
||||
// this.children.findByModel(model).search({ term : folderName }).always(function() {
|
||||
// if (!self.isClosed) {
|
||||
// self._showAndSearch(currentIndex + 1);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// else {
|
||||
// this.ui.loadingFolders.hide();
|
||||
// }
|
||||
// },
|
||||
//
|
||||
// itemViewOptions : {
|
||||
// isExisting : true
|
||||
// }
|
||||
|
||||
});
|
||||
|
@ -1,5 +1,4 @@
|
||||
<div class="x-list">
|
||||
<div class="loading-list x-loading-list">
|
||||
Loading search results from TheTVDB for your movies, this may take a few minutes.
|
||||
<div class="x-loading-list">
|
||||
</div>
|
||||
</div>
|
||||
|
@ -0,0 +1,22 @@
|
||||
var _ = require('underscore');
|
||||
var vent = require('vent');
|
||||
var AppLayout = require('../../AppLayout');
|
||||
var Backbone = require('backbone');
|
||||
var Marionette = require('marionette');
|
||||
var Config = require('../../Config');
|
||||
var Messenger = require('../../Shared/Messenger');
|
||||
var AsValidatedView = require('../../Mixins/AsValidatedView');
|
||||
|
||||
require('jquery.dotdotdot');
|
||||
|
||||
var view = Marionette.ItemView.extend({
|
||||
|
||||
template : 'AddMovies/SearchResultViewTemplate',
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
AsValidatedView.apply(view);
|
||||
|
||||
module.exports = view;
|
@ -0,0 +1,3 @@
|
||||
<div class="fetch-item">
|
||||
ASDF
|
||||
</div>
|
Loading…
Reference in new issue