1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-26 17:57:43 +00:00

minor js cleanup.

This commit is contained in:
kay.one 2013-02-21 22:18:36 -08:00
parent d3694461f1
commit 85fd4248a6
7 changed files with 32 additions and 40 deletions

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectCodeStyleSettingsManager">
<option name="PER_PROJECT_SETTINGS">
<value />
</option>
</component>
</project>

View file

@ -0,0 +1,7 @@
<component name="ProjectDictionaryState">
<dictionary name="Keivan">
<words>
<w>rootfolder</w>
</words>
</dictionary>
</component>

View file

@ -1,5 +1,4 @@
define(['app', 'AddSeries/RootFolders/RootFolderCollection', 'AddSeries/New/SearchResultView', 'Shared/SpinnerView'], function (app, rootFolders) { define(['app', 'AddSeries/RootFolders/RootFolderCollection', 'AddSeries/New/SearchResultView', 'Shared/SpinnerView'], function () {
NzbDrone.AddSeries.New.AddNewSeriesView = Backbone.Marionette.Layout.extend({ NzbDrone.AddSeries.New.AddNewSeriesView = Backbone.Marionette.Layout.extend({
template: 'AddSeries/New/AddNewSeriesTemplate', template: 'AddSeries/New/AddNewSeriesTemplate',
route: 'Series/add/new', route: 'Series/add/new',
@ -35,18 +34,18 @@
var term = context.ui.seriesSearch.val(); var term = context.ui.seriesSearch.val();
context.collection.reset(); context.collection.reset();
if (term !== '') { if (term === '') {
context.searchResult.close();
} else {
context.searchResult.show(new NzbDrone.Shared.SpinnerView()); context.searchResult.show(new NzbDrone.Shared.SpinnerView());
context.currentSearchRequest = context.collection.fetch({ context.currentSearchRequest = context.collection.fetch({
data: { term: term }, data: { term: term },
success: function (model) { success: function () {
context.searchResult.show(context.resultView); context.searchResult.show(context.resultView);
} }
}); });
} else {
context.searchResult.close();
} }
}, },

View file

@ -28,7 +28,7 @@ define(['app','Shared/NotificationCollection', 'AddSeries/SearchResultCollection
var quality = this.ui.qualityProfile.val(); var quality = this.ui.qualityProfile.val();
var rootFolderId = this.ui.rootFolder.val(); var rootFolderId = this.ui.rootFolder.val();
//Todo: This wiil create an invalid path on linux... //Todo: This will create an invalid path on linux...
var rootPath = this.model.get('rootFolders').get(rootFolderId).get('path'); var rootPath = this.model.get('rootFolders').get(rootFolderId).get('path');
var path = rootPath + "\\" + title; var path = rootPath + "\\" + title;
@ -62,11 +62,10 @@ define(['app','Shared/NotificationCollection', 'AddSeries/SearchResultCollection
NzbDrone.AddSeries.SearchResultView = Backbone.Marionette.CollectionView.extend({ NzbDrone.AddSeries.SearchResultView = Backbone.Marionette.CollectionView.extend({
itemView: NzbDrone.AddSeries.New.SearchItemView, itemView: NzbDrone.AddSeries.New.SearchItemView,
className: 'accordion', className: 'accordion',
initialize: function () { initialize: function () {
this.listenTo(this.collection, 'reset', this.render); this.listenTo(this.collection, 'reset', this.render);
} }
}); });
}); });

View file

@ -26,25 +26,3 @@
}; };
} ()); } ());
/*
var xhrMixin = function (){
console.log ('mixing in xhr');
var originalOnRender = Backbone.Marionette.View.prototype.onRender;
var originalBeforeClose = Backbone.Marionette.View.prototype.beforeClose;
Backbone.Marionette.View.prototype.onRender = function (){
console.log ('render');
if (originalOnRender){
originalOnRender.call (this);
}
};
Backbone.Marionette.View.prototype.beforeClose = function (){
console.log ('beforeClose');
if (originalBeforeClose){
originalBeforeClose.call (this);
}
};
} ();*/