mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-13 16:43:58 -07:00
broken
This commit is contained in:
parent
0916c8b8d1
commit
24c77b4047
29 changed files with 610 additions and 517 deletions
40
UI/AddSeries/Existing/CollectionView.js
Normal file
40
UI/AddSeries/Existing/CollectionView.js
Normal file
|
@ -0,0 +1,40 @@
|
|||
'use strict';
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'AddSeries/Existing/CompositeView',
|
||||
'AddSeries/Existing/UnmappedFolderCollection'
|
||||
], function (Marionette, UnmappedFolderCompositeView, UnmappedFolderCollection) {
|
||||
|
||||
return Marionette.CollectionView.extend({
|
||||
|
||||
itemView: UnmappedFolderCompositeView,
|
||||
|
||||
initialize: function () {
|
||||
this.collection = new UnmappedFolderCollection();
|
||||
this.refreshItems();
|
||||
},
|
||||
|
||||
refreshItems: function () {
|
||||
this.collection.importItems(this.model);
|
||||
},
|
||||
|
||||
showCollection: function () {
|
||||
this._showAndSearch(0);
|
||||
},
|
||||
|
||||
_showAndSearch: function (index) {
|
||||
|
||||
var model = this.collection.at(index);
|
||||
if (model) {
|
||||
var that = this;
|
||||
var currentIndex = index;
|
||||
this.addItemView(model, this.getItemView(), index);
|
||||
$.when(this.children.findByModel(model).search()).then(function () {
|
||||
that._showAndSearch(currentIndex + 1);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue