+
-
diff --git a/NzbDrone.Web/_backboneApp/AddSeries/AddNewSeries/AddNewSeriesView.js b/NzbDrone.Web/_backboneApp/AddSeries/AddNewSeries/AddNewSeriesView.js
index 7f0998e48..e425004dd 100644
--- a/NzbDrone.Web/_backboneApp/AddSeries/AddNewSeries/AddNewSeriesView.js
+++ b/NzbDrone.Web/_backboneApp/AddSeries/AddNewSeries/AddNewSeriesView.js
@@ -5,7 +5,7 @@
NzbDrone.AddSeries.SearchItemView = Backbone.Marionette.ItemView.extend({
template: "AddSeries/AddNewSeries/SearchResultTemplate",
- className: 'well',
+ className: 'search-item-view well',
onRender: function () {
NzbDrone.ModelBinder.bind(this.model, this.el);
}
@@ -24,7 +24,7 @@ NzbDrone.AddSeries.SearchResultView = Backbone.Marionette.CollectionView.extend(
NzbDrone.AddSeries.AddNewSeriesView = Backbone.Marionette.Layout.extend({
template: "AddSeries/AddNewSeries/AddNewSeriesTemplate",
- route : "Series/add/new",
+ route: "Series/add/new",
ui: {
seriesSearch: '.search input'
@@ -36,9 +36,8 @@ NzbDrone.AddSeries.AddNewSeriesView = Backbone.Marionette.Layout.extend({
collection: new NzbDrone.AddSeries.SearchResultCollection(),
- onRender: function () {
- //NzbDrone.Router.navigate(this.route, { trigger: true });
+ onRender: function () {
console.log('binding auto complete');
var self = this;
@@ -49,20 +48,27 @@ NzbDrone.AddSeries.AddNewSeriesView = Backbone.Marionette.Layout.extend({
self.$el.data('timeout', setTimeout(self.search, 500, self));
});
- this.searchResult.show(new NzbDrone.AddSeries.SearchResultView({ collection: this.collection }));
+ this.resultView = new NzbDrone.AddSeries.SearchResultView({ collection: this.collection });
+
},
search: function (context) {
var term = context.ui.seriesSearch.val();
+ context.collection.reset();
+
+ if (term != "") {
+ context.searchResult.show(new NzbDrone.Shared.SpinnerView());
- if (term == "") {
- context.collection.reset();
+ context.collection.fetch({
+ data: $.param({ term: term }),
+ success: function () {
+ context.searchResult.show(context.resultView);
+ }
+
+ });
} else {
- console.log(term);
- context.collection.fetch({ data: $.param({ term: term }) });
+ context.searchResult.close();
}
-
-
},
});
\ No newline at end of file
diff --git a/NzbDrone.Web/_backboneApp/AddSeries/AddNewSeries/SearchResultTemplate.html b/NzbDrone.Web/_backboneApp/AddSeries/AddNewSeries/SearchResultTemplate.html
index 595a76716..5241a049c 100644
--- a/NzbDrone.Web/_backboneApp/AddSeries/AddNewSeries/SearchResultTemplate.html
+++ b/NzbDrone.Web/_backboneApp/AddSeries/AddNewSeries/SearchResultTemplate.html
@@ -1,7 +1,5 @@
-
{{seriesName}} ({{seriesYear}})
-
+
{{seriesName}} ({{seriesYear}})
-
diff --git a/NzbDrone.Web/_backboneApp/AddSeries/AddSeriesLayout.js b/NzbDrone.Web/_backboneApp/AddSeries/AddSeriesLayout.js
index 3ca4241e7..8b0fa4edc 100644
--- a/NzbDrone.Web/_backboneApp/AddSeries/AddSeriesLayout.js
+++ b/NzbDrone.Web/_backboneApp/AddSeries/AddSeriesLayout.js
@@ -1,6 +1,7 @@
///
///
///
+///
NzbDrone.AddSeries.AddSeriesLayout = Backbone.Marionette.Layout.extend({
template: "AddSeries/addSeriesLayoutTemplate",
diff --git a/NzbDrone.Web/_backboneApp/AddSeries/addSeries.css b/NzbDrone.Web/_backboneApp/AddSeries/addSeries.css
index 891716249..1c0aef6a7 100644
--- a/NzbDrone.Web/_backboneApp/AddSeries/addSeries.css
+++ b/NzbDrone.Web/_backboneApp/AddSeries/addSeries.css
@@ -29,6 +29,10 @@
padding-left: 20px;
}
+.result-item *[class*='icon-'] {
+ padding-right: 10px;
+}
+
.result-list .result-item a {
font-size: 20px;
}
diff --git a/NzbDrone.Web/_backboneApp/Content/base.css b/NzbDrone.Web/_backboneApp/Content/base.css
index 913aa23da..8d07034b3 100644
--- a/NzbDrone.Web/_backboneApp/Content/base.css
+++ b/NzbDrone.Web/_backboneApp/Content/base.css
@@ -51,3 +51,10 @@ body {
#footer a:hover {
text-decoration: underline;
}
+
+
+.nz-spinner {
+ font-size: 56px;
+ text-align: center;
+ padding: 30px;
+}
diff --git a/NzbDrone.Web/_backboneApp/Shared/SpinnerTemplate.html b/NzbDrone.Web/_backboneApp/Shared/SpinnerTemplate.html
new file mode 100644
index 000000000..43c430f33
--- /dev/null
+++ b/NzbDrone.Web/_backboneApp/Shared/SpinnerTemplate.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/NzbDrone.Web/_backboneApp/Shared/SpinnerView.js b/NzbDrone.Web/_backboneApp/Shared/SpinnerView.js
new file mode 100644
index 000000000..9c04c03c2
--- /dev/null
+++ b/NzbDrone.Web/_backboneApp/Shared/SpinnerView.js
@@ -0,0 +1,8 @@
+///
+
+NzbDrone.Shared.SpinnerView = Backbone.Marionette.ItemView.extend({
+
+ template: "Shared/SpinnerTemplate",
+ className: 'nz-spinner row',
+
+});
diff --git a/NzbDrone.Web/_backboneApp/app.js b/NzbDrone.Web/_backboneApp/app.js
index efe9b9ded..7b59464c9 100644
--- a/NzbDrone.Web/_backboneApp/app.js
+++ b/NzbDrone.Web/_backboneApp/app.js
@@ -18,6 +18,7 @@ if (typeof console == "undefined") {
NzbDrone = new Backbone.Marionette.Application();
NzbDrone.AddSeries = NzbDrone.module("AddSeries");
+NzbDrone.Shared = NzbDrone.module("Shared");
_.templateSettings = {
interpolate: /\{\{([\s\S]+?)\}\}/g
@@ -41,18 +42,17 @@ NzbDrone.Routes = {
},
};
-http://localhost:65079/_backboneApp/Content
- NzbDrone.Controller = Backbone.Marionette.Controller.extend({
+NzbDrone.Controller = Backbone.Marionette.Controller.extend({
- addSeries: function () {
- NzbDrone.mainRegion.show(new NzbDrone.AddSeries.AddSeriesLayout());
- },
+ addSeries: function () {
+ NzbDrone.mainRegion.show(new NzbDrone.AddSeries.AddSeriesLayout());
+ },
- notFound: function () {
- alert('route not found');
- },
- });
+ notFound: function () {
+ alert('route not found');
+ },
+});
NzbDrone.Router = Backbone.Marionette.AppRouter.extend({