Skip to content

Instantly share code, notes, and snippets.

@ZakharDay
Created September 23, 2015 11:35
Show Gist options
  • Save ZakharDay/73645e1d8d1d11282872 to your computer and use it in GitHub Desktop.
Save ZakharDay/73645e1d8d1d11282872 to your computer and use it in GitHub Desktop.
# If you have clickable element inside another clickable element
# you can handle outside element click with prevent default function
handleOutsideClick: (e) ->
# If you click on inside button you need to prevent outside action
if $(e.target).parents('.insideButton')
e.preventDefault()
# Else you can do what you want
else
@doSomething()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment