Sha256: 5d3e7a65c2dcdb93da04889912630c32c5e8cdc7916eaf9a7a1052ffc7179f9d
Contents?: true
Size: 1.04 KB
Versions: 58
Compression:
Stored size: 1.04 KB
Contents
$(() => { const $notificationsBellIcon = $(".title-bar .topbar__notifications"); const $wrapper = $(".wrapper"); const $section = $wrapper.find("#notifications"); const $noNotificationsText = $(".empty-notifications"); const $pagination = $wrapper.find("ul.pagination"); const FADEOUT_TIME = 500; const anyNotifications = () => $wrapper.find(".card--widget").length > 0; const emptyNotifications = () => { if (!anyNotifications()) { $section.remove(); $noNotificationsText.removeClass("hide"); } }; $section.on("click", ".mark-as-read-button", (event) => { const $item = $(event.target).parents(".card--widget"); $item.fadeOut(FADEOUT_TIME, () => { $item.remove(); emptyNotifications(); }); }); $wrapper.on("click", ".mark-all-as-read-button", () => { $section.fadeOut(FADEOUT_TIME, () => { $pagination.remove(); $notificationsBellIcon.removeClass("is-active"); $wrapper.find(".card--widget").remove(); emptyNotifications(); }); }); emptyNotifications(); });
Version data entries
58 entries across 58 versions & 1 rubygems