minor js cleanup.

pull/6/head
kay.one 12 years ago
parent d3694461f1
commit 85fd4248a6

@ -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>

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

@ -1,10 +1,10 @@
define([ define([
'app', 'app',
'AddSeries/RootFolders/RootFolderCollection', 'AddSeries/RootFolders/RootFolderCollection',
'Quality/QualityProfileCollection', 'Quality/QualityProfileCollection',
'AddSeries/RootFolders/RootFolderView', 'AddSeries/RootFolders/RootFolderView',
'AddSeries/New/AddNewSeriesView', 'AddSeries/New/AddNewSeriesView',
'AddSeries/Existing/ImportSeriesView' 'AddSeries/Existing/ImportSeriesView'
], ],
function (app, rootFolderCollection, qualityProfileCollection) { function (app, rootFolderCollection, qualityProfileCollection) {
NzbDrone.AddSeries.AddSeriesLayout = Backbone.Marionette.Layout.extend({ NzbDrone.AddSeries.AddSeriesLayout = Backbone.Marionette.Layout.extend({

@ -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();
} }
}, },

@ -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);
} }
}); });
}); });

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

@ -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);
}
};
} ();*/

Loading…
Cancel
Save