client side code webstorm code cleanup.

This commit is contained in:
kay.one 2013-03-29 16:28:58 -07:00
parent 375f887539
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'
});