Sha256: c48d1b133ace2e40939c048d9f22154165a0d85ddddb931437f42a76be4d6d5c
Contents?: true
Size: 771 Bytes
Versions: 5
Compression:
Stored size: 771 Bytes
Contents
pw.component.register('notifier', function (view, config) { var that = this; this.listen('notification:published', function (payload) { that.show(payload.notification); }); this.listen('response:received', function (payload) { //TODO support notification type and add a class based on it for styling var notification = payload.response.headers['Pakyow-Notify']; if (notification) { that.show(notification); } }); view.node.addEventListener('click', function (evt) { view.node.classList.add('hide'); }); this.message = function (channel, payload) { that.show(payload.notification); }; this.show = function (notification) { view.node.innerText = notification; view.node.classList.remove('hide'); }; });
Version data entries
5 entries across 5 versions & 1 rubygems