From 8aefef49fea37abf2b5cf67fecae8651962a30ac Mon Sep 17 00:00:00 2001 From: Bert Pareyn Date: Sun, 19 Jan 2014 14:19:39 +0000 Subject: [PATCH 1/2] Add alert-dismissable for Bootstrap 3 usage --- js/bootstrap-notify.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/bootstrap-notify.js b/js/bootstrap-notify.js index caa3f12..cd8e2f6 100644 --- a/js/bootstrap-notify.js +++ b/js/bootstrap-notify.js @@ -1,7 +1,7 @@ /** * bootstrap-notify.js v1.0 * -- - * Copyright 2012 Goodybag, Inc. + * Copyright 2012 Goodybag, Inc. * -- * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,9 +19,12 @@ (function ($) { var Notification = function (element, options) { // Element collection + this.options = $.extend(true, {}, $.fn.notify.defaults, options); this.$element = $(element); this.$note = $('
'); - this.options = $.extend(true, {}, $.fn.notify.defaults, options); + if (this.options.closable) { + this.$note = $('
'); + } // Setup from options if(this.options.transition) From 79714bb6d1c512de3ef7d8f531b286ef5c7cdf1d Mon Sep 17 00:00:00 2001 From: Bert Pareyn Date: Mon, 3 Feb 2014 10:02:22 +0000 Subject: [PATCH 2/2] Use addClass instead of creating element over again --- js/bootstrap-notify.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/bootstrap-notify.js b/js/bootstrap-notify.js index cd8e2f6..f428c03 100644 --- a/js/bootstrap-notify.js +++ b/js/bootstrap-notify.js @@ -23,7 +23,7 @@ this.$element = $(element); this.$note = $('
'); if (this.options.closable) { - this.$note = $('
'); + this.$note.addClass('alert-dismissable'); } // Setup from options