juliancwirko / meteor-s-alert

Simple and fancy notifications for Meteor
https://atmospherejs.com/juliancwirko/s-alert
190 stars 24 forks source link

Create an onclick event for the alert #49

Closed chackerian closed 8 years ago

chackerian commented 8 years ago

How can I execute a function when the user clicks on the sAlert?

juliancwirko commented 8 years ago

The simpler way is to just create new event for sAlert template in your app:

Template.sAlert.events({
    'click .s-alert-box'() {
        console.log('test test');
    }
});

If you need you can also overwrite the template and create some buttons or links in the alert. You will find docs here: https://github.com/juliancwirko/meteor-s-alert#template-overwriting

chackerian commented 8 years ago

Thanks, that makes sense. Great work on the sAlert project.