Fix RES expando replacing

This commit is contained in:
Shadowfacts 2016-09-10 12:50:13 -04:00
parent 5b5f1bed27
commit 8dc3589f02
No known key found for this signature in database
GPG Key ID: F802198A7D7F309D
1 changed files with 15 additions and 12 deletions

View File

@ -1,16 +1,19 @@
// replace RES expando icons with reddit ones
(function() {
function fixExpandos() {
$("a.expando-button").each((i, el) => {
el = $(el);
if (!el.hasClass("selftext") && !el.hasClass("video")) {
el.removeClass("image");
el.removeClass("gallery");
el.addClass("video");
el.click(() => {
if (el.hasClass("expanded")) {
el.removeClass("image");
el.removeClass("gallery");
el.addClass("video");
} else {
el.addClass("video");
}
});
}
});
}
setTimeout(fixExpandos, 50);
})();