Created
August 25, 2010 05:01
-
-
Save BlairDuncan/548887 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
| @implementation LPMultiLineTextField(fix) | |
| - (void)layoutSubviews | |
| { | |
| [super layoutSubviews]; | |
| var contentView = [self layoutEphemeralSubviewNamed:@"content-view" | |
| positioned:CPWindowAbove | |
| relativeToEphemeralSubviewNamed:@"bezel-view"]; | |
| [contentView setHidden:YES]; | |
| var DOMElement = [self _DOMTextareaElement], | |
| contentInset = [self currentValueForThemeAttribute:@"content-inset"], | |
| bounds = [self bounds]; | |
| DOMElement.style.top = contentInset.top + @"px"; | |
| DOMElement.style.bottom = contentInset.bottom + @"px"; | |
| DOMElement.style.left = contentInset.left + @"px"; | |
| DOMElement.style.right = contentInset.right + @"px"; | |
| DOMElement.style.width = (CGRectGetWidth(bounds) - contentInset.left - contentInset.right) + @"px"; | |
| DOMElement.style.height = (CGRectGetHeight(bounds) - contentInset.top - contentInset.bottom) + @"px"; | |
| DOMElement.style.color = [[self currentValueForThemeAttribute:@"text-color"] cssString]; | |
| DOMElement.style.font = [[self currentValueForThemeAttribute:@"font"] cssString]; | |
| DOMElement.value = _stringValue || @""; | |
| // this switch case adds support for text alignment | |
| switch ([self currentValueForThemeAttribute:@"alignment"]) | |
| { | |
| case CPCenterTextAlignment: | |
| DOMElement.style.textAlign = "center"; | |
| break; | |
| case CPRightTextAlignment: | |
| DOMElement.style.textAlign = "right"; | |
| break; | |
| default: | |
| DOMElement.style.textAlign = "left"; | |
| } | |
| } | |
| @end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment