javascript - Backbone - why doesn't this helper function work? -
i have helper module in backbone app includes togglevisibility function:
return{ togglevisibility: function( ele ){ if ( ele.hasclass('hidden') ){ ele.removeclass('hidden').show(200); } else { ele.addclass('hidden').hide(200); } }, }; now, if call in view:
helpers.togglevisibility( this.$el ); it doesn't work. however, if following instead of call, desired functionality, exact same i'm doing in function:
this.$el.removeclass( 'hidden').show(200); further this, helper function works other elements aren't in view. pointers what's going here? pretty new backbone, assume newbie explanation please :)
Comments
Post a Comment