Sha256: 1b42e478f9922921cd0046207228ccd16dd554dd47bf2e723eb5a58d6083fa7a
Contents?: true
Size: 953 Bytes
Versions: 20
Compression:
Stored size: 953 Bytes
Contents
$(() => { const remToPx = (count) => { const unit = $("html").css("font-size"); if (typeof count !== "undefined" && count > 0) { return (parseInt(unit, 10) || 0) * count; } return parseInt(unit, 10) || 0; }; const $button = $(".voting-description-cell .content-height-toggler .button"); const $content = $button.closest(".voting-description-cell").find(".content"); const contentHeight = $content.height(); let contentMaxHeight = remToPx(7.8); if ($("#introductory-image").length) { contentMaxHeight = $("#introductory-image").height(); } if (contentHeight < contentMaxHeight) { $button.hide(); } else { $content.css("max-height", contentMaxHeight); } $button.on("click", () => { const $buttonTextLess = $button.find(".button-text.show-less-content"); let newHeight = contentMaxHeight; $content.css("max-height", newHeight); $buttonTextLess.toggleClass("hide"); }); });
Version data entries
20 entries across 20 versions & 1 rubygems