1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-25 17:27:18 +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,10 +1,10 @@
define([
'app',
'AddSeries/RootFolders/RootFolderCollection',
'Quality/QualityProfileCollection',
'AddSeries/RootFolders/RootFolderView',
'AddSeries/New/AddNewSeriesView',
'AddSeries/Existing/ImportSeriesView'
'app',
'AddSeries/RootFolders/RootFolderCollection',
'Quality/QualityProfileCollection',
'AddSeries/RootFolders/RootFolderView',
'AddSeries/New/AddNewSeriesView',
'AddSeries/Existing/ImportSeriesView'
],
function (app, rootFolderCollection, qualityProfileCollection) {
NzbDrone.AddSeries.AddSeriesLayout = Backbone.Marionette.Layout.extend({

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({
template: 'AddSeries/New/AddNewSeriesTemplate',
route: 'Series/add/new',
@ -35,18 +34,18 @@
var term = context.ui.seriesSearch.val();
context.collection.reset();
if (term !== '') {
if (term === '') {
context.searchResult.close();
} else {
context.searchResult.show(new NzbDrone.Shared.SpinnerView());
context.currentSearchRequest = context.collection.fetch({
data: { term: term },
success: function (model) {
success: function () {
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 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 path = rootPath + "\\" + title;
@ -62,11 +62,10 @@ define(['app','Shared/NotificationCollection', 'AddSeries/SearchResultCollection
NzbDrone.AddSeries.SearchResultView = Backbone.Marionette.CollectionView.extend({
itemView: NzbDrone.AddSeries.New.SearchItemView,
className: 'accordion',
initialize: function () {
this.listenTo(this.collection, 'reset', this.render);
}
});
});

View file

@ -1,8 +1,8 @@
<td name="path" class="span10" />
<td name="path" class="span10"/>
<td class="span3">
<span name="freeSpaceString"></span>
</td>
<td class="span1 nz-row-action">
<div class="btn btn-danger icon-minus x-remove">
</div>
</div>
</td>

View file

@ -25,26 +25,4 @@
}
};
} ());
/*
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);
}
};
} ();*/
} ());