diff --git a/build/ui.js b/build/ui.js index b83de45..0b158e1 100644 --- a/build/ui.js +++ b/build/ui.js @@ -965,6 +965,7 @@ exports.error = type('error'); */ function Notification(options) { + ui.Emitter.call(this); options = options || {}; this.template = html; this.el = $(this.template); @@ -972,6 +973,11 @@ function Notification(options) { if (Notification.effect) this.effect(Notification.effect); }; +/** + * Inherit from `Emitter.prototype`. + */ + +Notification.prototype = new ui.Emitter; /** * Render with the given `options`. @@ -991,6 +997,11 @@ Notification.prototype.render = function(options){ return false; }); + el.click(function(e){ + e.preventDefault(); + self.emit('click', e); + }); + el.find('h1').text(title); if (!title) el.find('h1').remove(); diff --git a/lib/components/notification/notification.js b/lib/components/notification/notification.js index e99afdb..5f007c5 100644 --- a/lib/components/notification/notification.js +++ b/lib/components/notification/notification.js @@ -77,6 +77,7 @@ exports.error = type('error'); */ function Notification(options) { + ui.Emitter.call(this); options = options || {}; this.template = html; this.el = $(this.template); @@ -84,6 +85,11 @@ function Notification(options) { if (Notification.effect) this.effect(Notification.effect); }; +/** + * Inherit from `Emitter.prototype`. + */ + +Notification.prototype = new ui.Emitter; /** * Render with the given `options`. @@ -103,6 +109,11 @@ Notification.prototype.render = function(options){ return false; }); + el.click(function(e){ + e.preventDefault(); + self.emit('click', e); + }); + el.find('h1').text(title); if (!title) el.find('h1').remove();