diff --git a/README.md b/README.md index 3f6a375..ae490b8 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ You can see a [demo](http://flash-messages-demo.meteor.com/) and their [source c ##Note -The syntax has changed on version 0.2.0 +This flash message is based on this [repo](https://github.com/camilosw/flash-messages.git). I added an option for close button. See below. ##Usage @@ -64,4 +64,5 @@ You can also set individual options on messages. This will override global confi FlashMessages.sendWarning("Message", { autoHide: false }); FlashMessages.sendError("Message", { hideDelay: 2000 }); FlashMessages.sendSuccess("Message", { autoHide: true, hideDelay: 8000 }); + FlashMessages.sendInfor("Message", {showCloseButton: true}); // by default this is false ``` diff --git a/messages.js b/messages.js index 906b5c1..9e457e6 100644 --- a/messages.js +++ b/messages.js @@ -34,7 +34,8 @@ FlashMessages = { options: { autoHide: true, hideDelay: 5000, - autoScroll: true + autoScroll: true, + showCloseButton: false } } @@ -42,5 +43,6 @@ sendMessage = function(message, style, options) { options = options || {}; options.autoHide = options.autoHide === undefined ? FlashMessages.options.autoHide : options.autoHide; options.hideDelay = options.hideDelay || FlashMessages.options.hideDelay; + options.showCloseButton = options.showCloseButton === undefined ? FlashMessages.options.showCloseButton : options.showCloseButton; flashMessages.insert({ message: message, style: style, seen: false, options: options}); } \ No newline at end of file diff --git a/messages_list.html b/messages_list.html index 34aa5b9..8e894cb 100644 --- a/messages_list.html +++ b/messages_list.html @@ -6,7 +6,9 @@