Skip to content

Instantly share code, notes, and snippets.

@nicolaracco
Created October 21, 2011 13:27
Show Gist options
  • Save nicolaracco/1303847 to your computer and use it in GitHub Desktop.
Save nicolaracco/1303847 to your computer and use it in GitHub Desktop.
bindEvents refactoring
Class Product
options: ['size', 'fitting', 'last']
constructor: (@availabilities) ->
@bindEvents()
bindEvents: ->
for option in @options
callback = _(@optionClickHandler).bind @, option
@container(option).find('a').click callback
optionClickHandler: (option, event) ->
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment