minor cleanup.
This commit is contained in:
parent
c2f438c18a
commit
763c4bd25b
|
@ -1,19 +1,19 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
Backgrid.Column.prototype.defaults = {
|
Backgrid.Column.prototype.defaults = {
|
||||||
name: undefined,
|
name : undefined,
|
||||||
label: undefined,
|
label : undefined,
|
||||||
sortable: true,
|
sortable : true,
|
||||||
editable: false,
|
editable : false,
|
||||||
renderable: true,
|
renderable: true,
|
||||||
formatter: undefined,
|
formatter : undefined,
|
||||||
cell: undefined,
|
cell : undefined,
|
||||||
headerCell: 'nzbDrone'
|
headerCell: 'nzbDrone'
|
||||||
};
|
};
|
||||||
|
|
||||||
Backgrid.TemplateBackedCell = Backgrid.Cell.extend({
|
Backgrid.TemplateBackedCell = Backgrid.Cell.extend({
|
||||||
className: '',
|
className: '',
|
||||||
template: 'Series/Index/Table/ControlsColumnTemplate',
|
template : 'Series/Index/Table/ControlsColumnTemplate',
|
||||||
|
|
||||||
render: function () {
|
render: function () {
|
||||||
var data = this.model.toJSON();
|
var data = this.model.toJSON();
|
||||||
|
@ -53,8 +53,12 @@ Backgrid.NzbDroneHeaderCell = Backgrid.HeaderCell.extend({
|
||||||
|
|
||||||
direction: function (dir) {
|
direction: function (dir) {
|
||||||
if (arguments.length) {
|
if (arguments.length) {
|
||||||
if (this._direction) this.$el.children('i').removeClass(this._convertDirectionToIcon(this._direction));
|
if (this._direction) {
|
||||||
if (dir) this.$el.children('i').addClass(this._convertDirectionToIcon(dir));
|
this.$el.children('i').removeClass(this._convertDirectionToIcon(this._direction));
|
||||||
|
}
|
||||||
|
if (dir) {
|
||||||
|
this.$el.children('i').addClass(this._convertDirectionToIcon(dir));
|
||||||
|
}
|
||||||
this._direction = dir;
|
this._direction = dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +78,9 @@ Backgrid.NzbDroneHeaderCell = Backgrid.HeaderCell.extend({
|
||||||
if (leftVal === rightVal) {
|
if (leftVal === rightVal) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else if (leftVal > rightVal) { return -1; }
|
else if (leftVal > rightVal) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -85,7 +91,9 @@ Backgrid.NzbDroneHeaderCell = Backgrid.HeaderCell.extend({
|
||||||
if (leftVal === rightVal) {
|
if (leftVal === rightVal) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else if (leftVal < rightVal) { return -1; }
|
else if (leftVal < rightVal) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -120,9 +128,9 @@ Backgrid.NzbDronePaginator = Backgrid.Extension.Paginator.extend({
|
||||||
|
|
||||||
fastForwardHandleLabels: {
|
fastForwardHandleLabels: {
|
||||||
first: '<i class="icon-fast-backward"></i>',
|
first: '<i class="icon-fast-backward"></i>',
|
||||||
prev: '<i class="icon-backward"></i>',
|
prev : '<i class="icon-backward"></i>',
|
||||||
next: '<i class="icon-forward"></i>',
|
next : '<i class="icon-forward"></i>',
|
||||||
last: '<i class="icon-fast-forward"></i>'
|
last : '<i class="icon-fast-forward"></i>'
|
||||||
},
|
},
|
||||||
|
|
||||||
changePage: function (e) {
|
changePage: function (e) {
|
||||||
|
@ -134,7 +142,7 @@ Backgrid.NzbDronePaginator = Backgrid.Extension.Paginator.extend({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$(target).is('a')){
|
if (!$(target).is('a')) {
|
||||||
target = target.parent('a');
|
target = target.parent('a');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,10 +174,10 @@ Backgrid.NzbDronePaginator = Backgrid.Extension.Paginator.extend({
|
||||||
|
|
||||||
var state = collection.state;
|
var state = collection.state;
|
||||||
var pageIndex = $(e.target).text() * 1;
|
var pageIndex = $(e.target).text() * 1;
|
||||||
collection.getPage(state.firstPage === 0 ? pageIndex - 1 : pageIndex);
|
collection.getPage(state.firstPage === 0 ? pageIndex - 1 :pageIndex);
|
||||||
},
|
},
|
||||||
|
|
||||||
preventLinkClick: function (e) {
|
preventLinkClick: function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
define(['app'], function (app) {
|
define(['app'], function () {
|
||||||
NzbDrone.Release.Model = Backbone.Model.extend({
|
NzbDrone.Release.Model = Backbone.Model.extend({
|
||||||
/* mutators: {
|
/* mutators: {
|
||||||
seasonNumber: function () {
|
seasonNumber: function () {
|
||||||
|
|
|
@ -15,7 +15,7 @@ define(function () {
|
||||||
return $el;
|
return $el;
|
||||||
},
|
},
|
||||||
|
|
||||||
showModal: function (view) {
|
showModal: function () {
|
||||||
this.$el.addClass('modal hide fade');
|
this.$el.addClass('modal hide fade');
|
||||||
|
|
||||||
//need tab index so close on escape works
|
//need tab index so close on escape works
|
||||||
|
@ -31,4 +31,4 @@ define(function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
define(['app'], function () {
|
"use strict";
|
||||||
|
|
||||||
|
define(['app'], function () {
|
||||||
NzbDrone.Shared.SpinnerView = Backbone.Marionette.ItemView.extend({
|
NzbDrone.Shared.SpinnerView = Backbone.Marionette.ItemView.extend({
|
||||||
template : 'Shared/SpinnerTemplate',
|
template : 'Shared/SpinnerTemplate',
|
||||||
className: 'nz-spinner row'
|
className: 'nz-spinner row'
|
||||||
|
|
Loading…
Reference in New Issue