Created
January 2, 2014 16:44
Revisions
-
joshualambert created this gist
Jan 2, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ // Used to fake hintText coloring to the font color. // Requires hintText to be defined on the object being passed. function hintTextShim(uiObject, isPswd) { uiObject.objectFocus = function () { if (uiObject.value === uiObject.hintText) { if (typeof isPswd !== 'undefined' && isPswd === true) { uiObject.passwordMask = true; } uiObject.value = ''; } }; uiObject.objectBlur = function () { if (uiObject.value === '') { if (typeof isPswd !== 'undefined' && isPswd === true) { uiObject.passwordMask = false; } uiObject.value = uiObject.hintText; } }; uiObject.addEventListener('focus', uiObject.objectFocus); uiObject.addEventListener('blur', uiObject.objectBlur); uiObject.objectBlur(); // Go ahead and set the default hintText. }