Sha256: 8d4e0e49e0ce2e2f7c6408caa04706f25eaf402972f46db8fae8fa20f7e1e0dd
Contents?: true
Size: 642 Bytes
Versions: 14
Compression:
Stored size: 642 Bytes
Contents
export default class Notification { /** * Initializes the notification widget on the page and allows * updating of the notification count and notification label * * @param {jQuery} element the notification widget */ constructor(element) { this.element = element this.counter = element.find('.count') } update(count, label) { this.element.attr('aria-label', label) this.counter.html(count) if (count === 0) { this.counter.addClass('invisible') } else { this.counter.removeClass('invisible') this.counter.addClass('badge-danger').removeClass('badge-secondary') } } }
Version data entries
14 entries across 14 versions & 1 rubygems