Skip to content

Instantly share code, notes, and snippets.

@boucher
Forked from anonymous/Subclassed CPTextField
Created October 22, 2008 21:40
Show Gist options
  • Save boucher/18814 to your computer and use it in GitHub Desktop.
Save boucher/18814 to your computer and use it in GitHub Desktop.
var CPTextFieldDOMInputElement = nil;
@implementation DTTextField : CPTextField
{
}
+ (DOMElement)_inputElement
{
if (!CPTextFieldDOMInputElement)
{
CPTextFieldDOMInputElement = document.createElement("input");
CPTextFieldDOMInputElement.type = "search";
CPTextFieldDOMInputElement.style.position = "absolute";
CPTextFieldDOMInputElement.style.top = "0px";
CPTextFieldDOMInputElement.style.left = "0px";
CPTextFieldDOMInputElement.style.width = "100%"
CPTextFieldDOMInputElement.style.height = "100%";
CPTextFieldDOMInputElement.style.border = "0px";
CPTextFieldDOMInputElement.style.padding = "0px";
CPTextFieldDOMInputElement.style.whiteSpace = "pre";
CPTextFieldDOMInputElement.style.background = "Yellow";
CPTextFieldDOMInputElement.style.outline = "none";
CPTextFieldDOMInputElement.style.paddingLeft = HORIZONTAL_PADDING - 1.0 + "px";
CPTextFieldDOMInputElement.style.paddingTop = TOP_PADDING - 2.0 + "px";
}
return CPTextFieldDOMInputElement;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment