From a0e23473364e1b467a89788a8fa08b20f493c15c Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Tue, 17 Aug 2010 16:35:10 -0500 Subject: [PATCH] textarea defaults to 100% width/height --- lib/WebGUI/Form/Textarea.pm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/WebGUI/Form/Textarea.pm b/lib/WebGUI/Form/Textarea.pm index e34a4811e..ba7d55bf4 100644 --- a/lib/WebGUI/Form/Textarea.pm +++ b/lib/WebGUI/Form/Textarea.pm @@ -77,7 +77,7 @@ sub definition { defaultValue=> 150 }, width=>{ - defaultValue=> 400 + defaultValue=> '100%', }, style=>{ defaultValue => undef, @@ -140,10 +140,16 @@ Renders an input tag of type text. sub toHtml { my $self = shift; my $value = $self->fixMacros($self->fixTags($self->fixSpecialCharacters(scalar $self->getOriginalValue))); - my $width = $self->get('width') || 400; - my $height = $self->get('height') || 150; + my $width = $self->get('width') || '100%'; + if ( $width !~ /%|px/ ) { + $width .= 'px'; + } + my $height = $self->get('height') || '100%'; + if ( $height !~ /%|px/ ) { + $height .= 'px'; + } my ($style, $url, $stow) = $self->session->quick(qw(style url stow)); - my $sizeStyle = ' width: ' . $width . 'px; height: ' . $height . 'px;'; + my $sizeStyle = ' width: ' . $width . '; height: ' . $height . ';'; my $out = '