Skip to content

Instantly share code, notes, and snippets.

@nickw
Created December 13, 2012 02:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickw/4273432 to your computer and use it in GitHub Desktop.
Save nickw/4273432 to your computer and use it in GitHub Desktop.
class CH.Views.PostFormView extends Backbone.View
events:
"focus #post_title": "focus"
initialize: ->
$("body").on "click", (event) => @blur(event)
focus: ->
@$(".post-form-expanded").show()
blur: (event) ->
$target = $(event.target)
unless $(@$("form.post-form")).has($target).length
@$(".post-form-expanded").hide()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment