Created
July 30, 2008 04:04
-
-
Save collin/3223 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() | |
var faux = $this.prev() | |
faux.show().val(faux.attr('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
The icky feelings that represent javascript start to rear their ugly heads around lines 5-6 | |
A number of times I've had this problem of needing to set a variable referencing another element. | |
instead of: | |
var faux = $this.prev() | |
faux.show().val(faux.attr('default_value')) | |
What about something like: | |
.prev() becomes faux | |
faux.show().val(faux.attr('default_value')) | |
or even | |
with .prev() | |
.show().val(@default_value) | |
OR is there already something do deal with/wholly circumvent this issue? | |
(I think you guys have $this as _jabl_context) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment