parent
fbe9ad6582
commit
032bc2d5c4
@ -1,51 +1,47 @@
|
|||||||
var Marionette = require('marionette');
|
var Marionette = require('marionette');
|
||||||
var AddMoviesView = require('../AddMoviesView');
|
var ListItemView = require('./ListItemView');
|
||||||
var vent = require('vent');
|
var vent = require('vent');
|
||||||
|
|
||||||
module.exports = Marionette.CompositeView.extend({
|
module.exports = Marionette.CollectionView.extend({
|
||||||
itemView : AddMoviesView,
|
itemView : ListItemView,
|
||||||
itemViewContainer : '.x-loading-folders',
|
|
||||||
template : 'AddMovies/List/AddFromListCollectionViewTemplate',
|
|
||||||
|
|
||||||
ui : {
|
ui : {
|
||||||
loadingFolders : '.x-loading-list'
|
loadingList : '.x-loading-list'
|
||||||
},
|
},
|
||||||
|
|
||||||
initialize : function() {
|
initialize : function() {
|
||||||
this.collection = new UnmappedFolderCollection();
|
|
||||||
this.collection.importItems(this.model);
|
|
||||||
},
|
|
||||||
|
|
||||||
showCollection : function() {
|
|
||||||
this._showAndSearch(0);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
appendHtml : function(collectionView, itemView, index) {
|
showCollection : function() {
|
||||||
collectionView.ui.loadingFolders.before(itemView.el);
|
},
|
||||||
},
|
//
|
||||||
|
// appendHtml : function(collectionView, itemView, index) {
|
||||||
_showAndSearch : function(index) {
|
// collectionView.ui.loadingFolders.before(itemView.el);
|
||||||
var self = this;
|
// },
|
||||||
var model = this.collection.at(index);
|
//
|
||||||
|
// _showAndSearch : function(index) {
|
||||||
if (model) {
|
// var self = this;
|
||||||
var currentIndex = index;
|
// var model = this.collection.at(index);
|
||||||
var folderName = model.get('folder').name;
|
//
|
||||||
this.addItemView(model, this.getItemView(), index);
|
// if (model) {
|
||||||
this.children.findByModel(model).search({ term : folderName }).always(function() {
|
// var currentIndex = index;
|
||||||
if (!self.isClosed) {
|
// var folderName = model.get('folder').name;
|
||||||
self._showAndSearch(currentIndex + 1);
|
// 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();
|
// }
|
||||||
}
|
//
|
||||||
},
|
// else {
|
||||||
|
// this.ui.loadingFolders.hide();
|
||||||
itemViewOptions : {
|
// }
|
||||||
isExisting : true
|
// },
|
||||||
}
|
//
|
||||||
|
// itemViewOptions : {
|
||||||
|
// isExisting : true
|
||||||
|
// }
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
<div class="x-list">
|
<div class="x-list">
|
||||||
<div class="loading-list x-loading-list">
|
<div class="x-loading-list">
|
||||||
Loading search results from TheTVDB for your movies, this may take a few minutes.
|
</div>
|
||||||
</div>
|
|
||||||
</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