Sha256: 6b857f39b5cb1d6060c9b591c830e66d50de6712581c5d406e68524d8f81c534
Contents?: true
Size: 640 Bytes
Versions: 61
Compression:
Stored size: 640 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('label-danger').removeClass('label-default') } } }
Version data entries
61 entries across 61 versions & 1 rubygems