Sha256: 6477caed3b2d933de81dc96df19bd7c5467f15f54fcf62e227339058ac32f6f4
Contents?: true
Size: 780 Bytes
Versions: 7
Compression:
Stored size: 780 Bytes
Contents
$(() => { const $creatorSelect = $("#import_creator"); const $creatorGuidances = $(".creator-guidances").find(".guidance"); const showGuidance = (text) => { const formatted = text.replace(/\s/g, "").toLocaleLowerCase(); $.each($creatorGuidances, (_index, currentValue) => { if (currentValue.className.includes(formatted)) { const elem = $(currentValue) elem.show(); } }) } $creatorSelect.on("change", function() { const text = $("#import_creator option:selected").text() $creatorGuidances.hide(); if (text) { showGuidance(text) } }) if ($creatorSelect.children("option").length < 2) { $("label[for='import_creator']").hide(); } $creatorGuidances.hide(); $creatorGuidances.first().show(); })
Version data entries
7 entries across 7 versions & 1 rubygems