Skip to content

Instantly share code, notes, and snippets.

@nex3
Forked from collin/gist:3223
Created July 30, 2008 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nex3/3262 to your computer and use it in GitHub Desktop.
Save nex3/3262 to your computer and use it in GitHub Desktop.
$.password
:blur
if @value === ""
.hide()
// Eventually, indenting beneath something will set it as the context
.prev()
.show().val(@default_value)
.blur()
$.faux-password
:focus
.hide().next().show().focus()
// At the moment, there is nothing like $this. But you can access properties of the context via .prop
var faux = .prev()
faux.show().val(faux.attr('default_value'))
// How is this better than the above? It just looks like a more verbose var
.prev() becomes faux
faux.show().val(faux.attr('default_value'))
// This is how it'll actually work
.prev()
.show().val(@default_value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment