🐛 pick-show Always add click event when page is reloaded

This commit is contained in:
Dan Jones 2020-08-28 16:27:17 -05:00
commit 6de306fd36

View file

@ -21,6 +21,10 @@
cheat: pickShow cheat: pickShow
}); });
function unghost() {
$(this).removeClass('sortable-ghost');
}
function addPickButton() { function addPickButton() {
const $leftNav = $('.subnav-wrapper .container .left'); const $leftNav = $('.subnav-wrapper .container .left');
const $found = $leftNav.find('.pick-episode'); const $found = $leftNav.find('.pick-episode');
@ -28,15 +32,13 @@
$leftNav.append('<span class="filter-dropdown toggle-simple-progress pick-episode" title="Pick Episode"><span class="icon trakt-icon-wand"></span></span>') $leftNav.append('<span class="filter-dropdown toggle-simple-progress pick-episode" title="Pick Episode"><span class="icon trakt-icon-wand"></span></span>')
.find('.pick-episode').on('click', pickShow); .find('.pick-episode').on('click', pickShow);
} }
$('div[data-type="show"]').on('click', unghost);
} }
addPickButton(); addPickButton();
const observer = new MutationObserver(addPickButton); const observer = new MutationObserver(addPickButton);
observer.observe(document.head.parentElement, {childList: true}); observer.observe(document.head.parentElement, {childList: true});
$('div[data-type="show"]').on('click', function () {
$(this).removeClass('sortable-ghost');
});
let watched_shows; let watched_shows;
function getWeightedIndex(total) { function getWeightedIndex(total) {