Skip to content

Instantly share code, notes, and snippets.

@latentflip
Created March 22, 2013 14:16
Show Gist options
  • Save latentflip/5221588 to your computer and use it in GitHub Desktop.
Save latentflip/5221588 to your computer and use it in GitHub Desktop.
$input.focus ->
_.defer -> $input.select()
arrow = $("<a href='#'>").text("➡").attr(tabindex: -1)
arrow.css({display: 'block', position: 'absolute', top: 4, right: -19, zIndex: 5, fontSize: 20})
arrow.insertAfter $input
arrow.mousedown (ev) ->
ev && (ev.preventDefault() || ev.stopPropagation)
budgetEntry.save({ modify_future_events: true }, { success: -> budgetEntry.set({modify_future_events: false}) })
$input.blur ->
val = $input.val()
budgetEntry.save({total: val})
arrow.remove()
@latentflip
Copy link
Author

I think it's obvious what this code is doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment