-
-
Save nex3/3262 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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