juliancwirko/meteor-s-alert

click to destroy alert

chongwang87 opened this issue · 3 comments

is it possible to implement a little feature to click/touch the individual alert to destroy it

Hey, check out this issue: #49 I think it is quite similar. You can close the alert by sAlert.close(alertId) alertId will be returned from init methods. You can also use a custom template and reuse .s-alert-close class see: https://github.com/juliancwirko/meteor-s-alert/blob/master/client/s-alert-template.js#L164

is it possible to implement it by default for all alert instead of customize the template?

If you use a custom template it will be applicable to all your alerts in the app. Default alerts are closed by 'close' icon so if you need your alerts to have different logic you can create your own close event as I described above or you can reuse existing close event by replacing '.s-alert-close' class. These are the options you can use in this case.