gadicc / meteor-famous-views

Famous, the Meteor Way (with Reactive Blaze Templates/Views)
http://famous-views.meteor.com/
GNU Lesser General Public License v3.0
332 stars 27 forks source link

Multiple FamousEvents() Trigger not working #256

Open mcope opened 9 years ago

mcope commented 9 years ago

I'm noticing that this works as expected: Template.x.famousEvents({ 'touchstart': function(){ ... } })

But this does not (multiple event trigger): Template.x.famousEvents({ 'touchstart, click': function(){ ... } })

Is this intended? Is there an easier way to create an event with multiple event trigger?

nickmacia commented 9 years ago

hey, you can try an alternate way of firing events, namely:

Template.xxx.rendered = function() {
   //boilerplate famous-views integration
    var fview = FView.from(this);
    var target = fview.surface || fview.view;

    target.on('click touchstart', function(e) { 
      //event logic here 
    });
}