-
+
diff --git a/NzbDrone.Web/_backboneApp/AddSeries/New/AddNewSeriesView.js b/NzbDrone.Web/_backboneApp/AddSeries/New/AddNewSeriesView.js
index 769fb9492..63a042f53 100644
--- a/NzbDrone.Web/_backboneApp/AddSeries/New/AddNewSeriesView.js
+++ b/NzbDrone.Web/_backboneApp/AddSeries/New/AddNewSeriesView.js
@@ -35,7 +35,7 @@ NzbDrone.AddSeries.AddNewSeriesView = Backbone.Marionette.Layout.extend({
onRender: function () {
console.log('binding auto complete');
var self = this;
-
+
this.ui.seriesSearch
.data('timeout', null)
.keyup(function () {
@@ -48,14 +48,16 @@ NzbDrone.AddSeries.AddNewSeriesView = Backbone.Marionette.Layout.extend({
},
search: function (context) {
-
+
+ context.abortExistingRequest();
+
var term = context.ui.seriesSearch.val();
context.collection.reset();
-
+
if (term !== '') {
context.searchResult.show(new NzbDrone.Shared.SpinnerView());
- context.collection.fetch({
+ context.currentSearchRequest = context.collection.fetch({
data: $.param({ term: term }),
success: function (model) {
context.resultUpdated(model, context);
@@ -67,6 +69,13 @@ NzbDrone.AddSeries.AddNewSeriesView = Backbone.Marionette.Layout.extend({
}
},
+ abortExistingRequest : function () {
+ if (this.currentSearchRequest && this.currentSearchRequest.readyState > 0 && this.currentSearchRequest.readyState < 4) {
+ console.log('aborting previous pending search request.');
+ this.currentSearchRequest.abort();
+ }
+ },
+
resultUpdated: function (options, context) {
_.each(options.models, function (model) {
diff --git a/NzbDrone.Web/_backboneApp/AddSeries/addSeries.css b/NzbDrone.Web/_backboneApp/AddSeries/addSeries.css
index 809a1594a..1bada16ab 100644
--- a/NzbDrone.Web/_backboneApp/AddSeries/addSeries.css
+++ b/NzbDrone.Web/_backboneApp/AddSeries/addSeries.css
@@ -52,3 +52,20 @@
.search-item select {
font-size: 16px;
}
+
+/*Existing*/
+.unmapped-folder-view {
+ background: #fcf8e3;
+ margin-top: 20px;
+ padding: 20px;
+}
+
+ .unmapped-folder-view .folder-header {
+ font-size: 30px;
+ font-weight:300
+
+ }
+
+.existing-root-folder-view, h1 {
+ padding: 10px 0px 20px 0px;
+}
diff --git a/NzbDrone.Web/_backboneApp/Content/Bootstrap/variables.less b/NzbDrone.Web/_backboneApp/Content/Bootstrap/variables.less
index ed6a90fb6..c17c72e96 100644
--- a/NzbDrone.Web/_backboneApp/Content/Bootstrap/variables.less
+++ b/NzbDrone.Web/_backboneApp/Content/Bootstrap/variables.less
@@ -44,7 +44,7 @@
// Typography
// -------------------------
-@sansFontFamily: "Segoe UI","Segoe WP", "Helvetica Neue", Helvetica, Arial, sans-serif;
+@sansFontFamily: "open sans", "Segoe UI","Segoe WP", "Helvetica Neue", Helvetica, Arial, sans-serif;
@serifFontFamily: Georgia, "Times New Roman", Times, serif;
@monoFontFamily: Monaco, Menlo, Consolas, "Courier New", monospace;
diff --git a/NzbDrone.Web/_backboneApp/Content/base.css b/NzbDrone.Web/_backboneApp/Content/base.css
index f0868aa5d..fdbb5dab8 100644
--- a/NzbDrone.Web/_backboneApp/Content/base.css
+++ b/NzbDrone.Web/_backboneApp/Content/base.css
@@ -67,3 +67,17 @@ body {
#notification-region i {
padding-right: 10px;
}
+
+
+.line {
+ height: 4em;
+ line-height: 4em;
+}
+
+ .line > [class^="icon-"], .line > [class*=" icon-"] {
+ margin-top: 1em;
+ height: 1em;
+ line-height: 1em;
+ }
+
+
diff --git a/NzbDrone.Web/_backboneApp/Shared/NotificationModel.js b/NzbDrone.Web/_backboneApp/Shared/NotificationModel.js
index 14b94de11..73deeeb4d 100644
--- a/NzbDrone.Web/_backboneApp/Shared/NotificationModel.js
+++ b/NzbDrone.Web/_backboneApp/Shared/NotificationModel.js
@@ -3,7 +3,9 @@ NzbDrone.Shared.NotificationModel = Backbone.Model.extend({
mutators: {
pre: function () {
- return this.get('message').lines().lenght > 1;
+ if (this.get('message')) {
+ return this.get('message').lines().lenght > 1;
+ }
},
iconClass: function () {
diff --git a/NzbDrone.Web/_backboneApp/Shared/NotificationView.js b/NzbDrone.Web/_backboneApp/Shared/NotificationView.js
index 5d24d4890..4df05825f 100644
--- a/NzbDrone.Web/_backboneApp/Shared/NotificationView.js
+++ b/NzbDrone.Web/_backboneApp/Shared/NotificationView.js
@@ -51,24 +51,32 @@ window.onerror = function (msg, url, line) {
model.set('level', 'error');
NzbDrone.Shared.NotificationCollectionView.Instance.collection.add(model);
} catch (error) {
- alert('Couldn\'t report JS error. ' + error);
+
+ console.log("An error occurred while reporting error. " + error);
+ console.log(msg);
+ alert('Couldn\'t report JS error. ' + msg);
}
- var suppressErrorAlert = false;
- return suppressErrorAlert;
+ return false; //don't suppress default alerts and logs.
};
$(document).ajaxError(function (event, xmlHttpRequest, ajaxOptions) {
+ //don't report 200 error codes
if (xmlHttpRequest.status >= 200 && xmlHttpRequest.status <= 300) {
- return;
+ return undefined;
}
+
+ //doesn't report aborted requests
+ if (xmlHttpRequest.statusText === 'abort') {
+ return undefined;
+ }
+
var model = new NzbDrone.Shared.NotificationModel();
model.set('title', ajaxOptions.type + " " + ajaxOptions.url + " : " + xmlHttpRequest.statusText);
model.set('message', xmlHttpRequest.responseText);
model.set('level', 'error');
NzbDrone.Shared.NotificationCollectionView.Instance.collection.push(model);
- var suppressErrorAlert = false;
- return suppressErrorAlert;
+ return false;
});
\ No newline at end of file