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 // replace RES expando icons with reddit ones
(function() { (function() {
$("a.expando-button").each((i, el) => { function fixExpandos() {
el = $(el); $("a.expando-button").each((i, el) => {
if (!el.hasClass("selftext") && !el.hasClass("video")) { el = $(el);
el.addClass("video"); if (!el.hasClass("selftext") && !el.hasClass("video")) {
el.click(() => { el.removeClass("image");
if (el.hasClass("expanded")) { el.removeClass("gallery");
el.addClass("video");
el.click(() => {
el.removeClass("image");
el.removeClass("gallery");
el.addClass("video"); el.addClass("video");
} else { });
el.addClass("video"); }
} });
}); }
} setTimeout(fixExpandos, 50);
});
})(); })();