Added auto complete to AddSeries RootDir

This commit is contained in:
Mark McDowall
2013-02-05 22:28:56 -08:00
committed by kay.one
parent 7ed148b12c
commit 7f0dc84b29
7 changed files with 86 additions and 1 deletions
@@ -2,6 +2,7 @@
/// <reference path="../../app.js" />
/// <reference path="RootDirModel.js" />
/// <reference path="RootDirCollection.js" />
/// <reference path="../../Shared/AutoComplete.js" />
NzbDrone.AddSeries.RootDirItemView = Backbone.Marionette.ItemView.extend({
@@ -53,6 +54,8 @@ NzbDrone.AddSeries.RootDirView = Backbone.Marionette.Layout.extend({
this.currentDirs.show(new NzbDrone.AddSeries.RootDirListView({ collection: this.collection }));
this.collection.fetch();
this.ui.pathInput.folderAutoComplete();
},
@@ -41,6 +41,10 @@ body {
text-align: center;
}
.nz-center .typeahead {
text-align: left;
}
#footer-region {
font-size: 16px;
text-decoration: none;
@@ -0,0 +1,16 @@
$.fn.folderAutoComplete = function () {
$(this).typeahead({
source: function (query, process) {
$.ajax({
url: '/api/directories',
dataType: "json",
type: "POST",
data: { query: query },
success: function (data) {
process(data);
}
});
},
minLength: 3
});
}