You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lidarr/src/UI/SeasonPass/SeasonsCell.js

26 lines
894 B

var _ = require('underscore');
var TemplatedCell = require('../Cells/TemplatedCell');
//require('../Handlebars/Helpers/Numbers');
module.exports = TemplatedCell.extend({
className : 'seasons-cell',
template : 'SeasonPass/SeasonsCellTemplate',
events : {
'click .x-season-monitored' : '_toggleSeasonMonitored'
},
_toggleSeasonMonitored : function(e) {
var target = this.$(e.target).closest('.x-season-monitored');
var seasonNumber = parseInt(this.$(target).data('season-number'), 10);
var icon = this.$(target).children('.x-season-monitored-icon');
this.model.setSeasonMonitored(seasonNumber);
//TODO: unbounce the save so we don't multiple to the server at the same time
var savePromise = this.model.save();
icon.spinForPromise(savePromise);
savePromise.always(this.render.bind(this));
}
});