add series lookup doesn't send a request to server with a blank filter.

pull/2/head
Keivan Beigi 12 years ago committed by kay.one
parent ebadd6b1d5
commit ae61150b84

@ -12,6 +12,14 @@
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
<add key="aspnet:MaxHttpCollectionKeys" value="5000" />
</appSettings>
<system.diagnostics>
<sources>
<source name="Cassette" switchName="CassetteSwitch" switchType="System.Diagnostics.SourceSwitch" />
</sources>
<switches>
<add name="CassetteSwitch" value="All" />
</switches>
</system.diagnostics>
<system.web>
<trust level="Full" originUrl=".*" />
<compilation debug="true" targetFramework="4.0" />

@ -58,7 +58,14 @@ NzbDrone.AddSeries.AddNewSeriesView = Backbone.Marionette.Layout.extend({
search: function (context) {
var term = context.ui.seriesSearch.val();
console.log(term);
context.collection.fetch({ data: $.param({ term: term }) });
if (term == "") {
context.collection.reset();
} else {
console.log(term);
context.collection.fetch({ data: $.param({ term: term }) });
}
},
});

@ -8,7 +8,6 @@ namespace NzbDrone.Web.Backbone.NzbDrone
public class CassetteBundleConfiguration : IConfiguration<BundleCollection>
{
public const string BASE_STYLE = "BASE_STYLE";
public const string BACKBONE = "BACKBONE";
public const string NZBDRONE = "NZBDRONE";
internal const string FONTS = "FONTS";
@ -28,7 +27,7 @@ namespace NzbDrone.Web.Backbone.NzbDrone
},
bundle => bundle.AddReference("/" + FONTS));
bundles.Add<ScriptBundle>("~/_backboneApp/JsLibraries/backbone.js");
bundles.Add<ScriptBundle>(NZBDRONE, new[]{
APP_PATH + "\\AddSeries\\AddSeriesLayout.js",

@ -1,7 +1,6 @@
/// <reference path="JsLibraries/jquery.js" />
/// <reference path="JsLibraries/underscore.js" />
/// <reference path="JsLibraries/backbone.js" />
/// <reference path="JsLibraries/backbone.debug.js" />
/// <reference path="JsLibraries/backbone.modelbinder.js" />
/// <reference path="JsLibraries/backbone.marionette.js" />
/// <reference path="JsLibraries/backbone.marionette.extend.js" />

Loading…
Cancel
Save