Reputation: 831
This works well in meteor.
Template.xxx.events = {
'click .btn-plus': function(event) {}
}
But in this example, the event were never fired.
Template.xxx.events = {
'click .btn.btn-success.btn-mini.btn-plus.pull-right': function(event) {}
}
Why you can't use multiple classes as selector? i need to identify the button on the .btn-plus class.
regards, cid
EDIT:
My temporary solution:
HTML-file:
<div class="btn-plus">
<button class="btn btn-primary btn-mini pull-right">Caption</button>
</div>
JS-file:
Template.xxx.events = {
'click .btn-plus': function(event) {}
}
Upvotes: 0
Views: 1544
Reputation: 31
http://docs.meteor.com/#eventmaps
Template.xxx.events({
'click .btn, click .btn-success, click .btn-mini, click .btn-plus, click .pull-right': function(event) {
console.log("clicked a button");
}
}
There is another page addressing this question here: Meteor JS: How to do I create event handler for multiple selectors?
Upvotes: 2
Reputation: 6356
I just took a quick peek at the docs. I think this will work...
Template.xxx.events = {
'click .btn .btn-success .btn-mini .btn-plus .pull-right': function(event) {}
}
Upvotes: 2