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

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -