More Season ignore work. Already ignored seasons will be ignored.

Fix: Season Ignore is handled separately from Episode Ignore.
This commit is contained in:
Mark McDowall 2012-02-20 22:50:38 -08:00
commit aac42d4882
12 changed files with 171 additions and 47 deletions

View file

@ -40,9 +40,7 @@ $(".ignoreEpisode").live("click", function () {
else {
//Check to see if this is the last one ignored or the first not ignored
seasonNumber = toggle.attr('class').split(/\s+/)[1].replace('ignoreEpisode_', '');
var episodeId = toggle.attr('id');
toggleMaster(seasonNumber, ignored);
saveEpisodeIgnore(episodeId, ignored);
}
});
@ -68,26 +66,6 @@ function toggleChildren(seasonNumber, ignored) {
}
}
function toggleMaster(seasonNumber) {
//Toggles all master toggles when the childen changes
var ignoreEpisodes = $('.ignoreEpisode_' + seasonNumber);
var ignoredCount = ignoreEpisodes.filter('.ignored').length;
var masters = $('.ignoreSeason_' + seasonNumber);
masters.each(function (index) {
if (ignoreEpisodes.length == ignoredCount) {
$(this).attr('src', ignoredImage);
$(this).addClass('ignored');
}
else {
$(this).attr('src', notIgnoredImage);
$(this).removeClass('ignored');
}
});
}
function toggleMasters(seasonNumber, ignored) {
//Toggles the other master(s) to match the one that was just changed
var masters = $('.ignoreSeason_' + seasonNumber);