mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
added ui structure for rootdirs.
This commit is contained in:
parent
ae61150b84
commit
157b559ed2
12 changed files with 133 additions and 8 deletions
62
NzbDrone.Web/_backboneApp/AddSeries/RootDir/RootDirView.js
Normal file
62
NzbDrone.Web/_backboneApp/AddSeries/RootDir/RootDirView.js
Normal file
|
@ -0,0 +1,62 @@
|
|||
/// <reference path="../../app.js" />
|
||||
/// <reference path="RootDirModel.js" />
|
||||
/// <reference path="RootDirCollection.js" />
|
||||
|
||||
NzbDrone.AddSeries.RootDirItemView = Backbone.Marionette.ItemView.extend({
|
||||
|
||||
template: "AddSeries/RootDir/RootDirItemTemplate",
|
||||
className: 'row',
|
||||
|
||||
onRender: function () {
|
||||
NzbDrone.ModelBinder.bind(this.model, this.el);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
NzbDrone.AddSeries.RootDirListView = Backbone.Marionette.CollectionView.extend({
|
||||
className: 'result',
|
||||
itemView: NzbDrone.AddSeries.RootDirItemView,
|
||||
});
|
||||
|
||||
NzbDrone.AddSeries.RootDirView = Backbone.Marionette.Layout.extend({
|
||||
template: "AddSeries/RootDir/RootDirTemplate",
|
||||
|
||||
ui: {
|
||||
pathInput: '.path input'
|
||||
},
|
||||
|
||||
regions: {
|
||||
currentDirs: "#current-dirs",
|
||||
},
|
||||
|
||||
collection: new NzbDrone.AddSeries.RootDirCollection(),
|
||||
|
||||
onRender: function () {
|
||||
var self = this;
|
||||
|
||||
/*
|
||||
this.ui.seriesSearch
|
||||
.data('timeout', null)
|
||||
.keyup(function () {
|
||||
clearTimeout(self.$el.data('timeout'));
|
||||
self.$el.data('timeout', setTimeout(self.search, 500, self));
|
||||
});
|
||||
*/
|
||||
|
||||
this.currentDirs.show(new NzbDrone.AddSeries.RootDirListView({ collection: this.collection }));
|
||||
},
|
||||
|
||||
search: function (context) {
|
||||
|
||||
var term = context.ui.seriesSearch.val();
|
||||
|
||||
if (term == "") {
|
||||
context.collection.reset();
|
||||
} else {
|
||||
console.log(term);
|
||||
context.collection.fetch({ data: $.param({ term: term }) });
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue