client side code webstorm code cleanup.

This commit is contained in:
kay.one 2013-03-29 16:28:58 -07:00
commit 445ea4f344
94 changed files with 4355 additions and 4243 deletions

View file

@ -2,9 +2,9 @@
define(['app', 'Quality/QualityProfileCollection', 'Series/Index/SeriesItemView'], function (app, qualityProfileCollection) {
NzbDrone.Series.Index.SeriesIndexCollectionView = Backbone.Marionette.CompositeView.extend({
itemView: NzbDrone.Series.Index.SeriesItemView,
itemViewContainer: 'tbody',
template: 'Series/Index/SeriesIndexTemplate',
itemView : NzbDrone.Series.Index.SeriesItemView,
itemViewContainer : 'tbody',
template : 'Series/Index/SeriesIndexTemplate',
qualityProfileCollection: qualityProfileCollection,
//emptyView: NzbDrone.Series.EmptySeriesCollectionView,
@ -18,27 +18,26 @@ define(['app', 'Quality/QualityProfileCollection', 'Series/Index/SeriesItemView'
this.itemViewOptions = { qualityProfiles: this.qualityProfileCollection };
},
ui:{
table : '.x-series-table'
ui: {
table: '.x-series-table'
},
onItemRemoved: function()
{
onItemRemoved: function () {
this.ui.table.trigger('update');
},
onCompositeCollectionRendered: function()
{
onCompositeCollectionRendered: function () {
this.ui.table.trigger('update');
if(!this.tableSorter && this.collection.length > 0)
{
if (!this.tableSorter && this.collection.length > 0) {
this.tableSorter = this.ui.table.tablesorter({
textExtraction: function (node) {
return node.innerHTML;
},
sortList: [[1,0]],
headers: {
sortList : [
[1, 0]
],
headers : {
0: {
sorter: 'title'
},
@ -59,30 +58,32 @@ define(['app', 'Quality/QualityProfileCollection', 'Series/Index/SeriesItemView'
this.applySortIcons();
this.ui.table.bind("sortEnd", function() {
this.ui.table.bind("sortEnd", function () {
this.applySortIcons();
});
}
else
{
else {
this.ui.table.trigger('update');
}
},
//Todo: Remove this from each view that requires it
applySortIcons: function() {
$(this.ui.table).find('th.tablesorter-header .tablesorter-header-inner i').each(function(){
applySortIcons : function () {
$(this.ui.table).find('th.tablesorter-header .tablesorter-header-inner i').each(function () {
$(this).remove();
});
$(this.ui.table).find('th.tablesorter-header').each(function () {
if ($(this).hasClass('tablesorter-headerDesc'))
if ($(this).hasClass('tablesorter-headerDesc')) {
$(this).children('.tablesorter-header-inner').append('<i class="icon-sort-up pull-right">');
}
else if ($(this).hasClass('tablesorter-headerAsc'))
else if ($(this).hasClass('tablesorter-headerAsc')) {
$(this).children('.tablesorter-header-inner').append('<i class="icon-sort-down pull-right">');
}
else if (!$(this).hasClass('sorter-false'))
else if (!$(this).hasClass('sorter-false')) {
$(this).children('.tablesorter-header-inner').append('<i class="icon-sort pull-right">');
}
});
}
});
@ -90,5 +91,5 @@ define(['app', 'Quality/QualityProfileCollection', 'Series/Index/SeriesItemView'
NzbDrone.Series.Index.EmptySeriesCollectionView = Backbone.Marionette.CompositeView.extend({
template: 'Series/Index/EmptySeriesCollectionTemplate',
tagName: 'tr'
tagName : 'tr'
});

View file

@ -8,8 +8,9 @@
<td>
<div class="progress">
<span class="progressbar-back-text">{{episodeFileCount}} / {{episodeCount}}</span>
<div class="bar" style="width:{{percentOfEpisodes}}%"><span class="progressbar-front-text">{{episodeFileCount}} / {{episodeCount}}</span></div>
</div>
</div>
</td>
<td>
<i class="icon-cog x-edit" title="Edit Series"></i>

View file

@ -1,24 +1,24 @@
'use strict';
define([
'app',
'Quality/QualityProfileCollection',
'Series/SeriesCollection',
'Series/Edit/EditSeriesView',
'Series/Delete/DeleteSeriesView'
'app',
'Quality/QualityProfileCollection',
'Series/SeriesCollection',
'Series/Edit/EditSeriesView',
'Series/Delete/DeleteSeriesView'
], function () {
NzbDrone.Series.Index.SeriesItemView = Backbone.Marionette.ItemView.extend({
template: 'Series/Index/SeriesItemTemplate',
tagName: 'tr',
tagName : 'tr',
ui: {
'progressbar': '.progress .bar'
},
events: {
'click .x-edit': 'editSeries',
'click .x-edit' : 'editSeries',
'click .x-remove': 'removeSeries'
},