From cbd9fcfa6ea24ebbd27b807d0b559b08a908b642 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Tue, 7 May 2013 15:24:27 +0200 Subject: [PATCH] =?utf8?q?areainput=20implementierung=20von=20cetaq=20?= =?utf8?q?=C3=BCbernommen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Template/Plugin/L.pm | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/SL/Template/Plugin/L.pm b/SL/Template/Plugin/L.pm index 241141625..4b56da832 100644 --- a/SL/Template/Plugin/L.pm +++ b/SL/Template/Plugin/L.pm @@ -344,19 +344,14 @@ sub tab { sub areainput_tag { my ($self, $name, $value, %attributes) = _hashify(3, @_); - my ($rows, $cols); - my $min = delete $attributes{min_rows} || 1; - - if (exists $attributes{cols}) { - $cols = delete $attributes{cols}; - $rows = $::form->numtextrows($value, $cols); - } else { - $rows = delete $attributes{rows} || 1; - } + my $cols = delete $attributes{cols} || delete $attributes{size}; + my $minrows = delete $attributes{min_rows} || 1; + my $maxrows = delete $attributes{max_rows}; + my $rows = $::form->numtextrows($value, $cols, $maxrows, $minrows); return $rows > 1 - ? $self->textarea_tag($name, $value, %attributes, rows => max($rows, $min), ($cols ? (cols => $cols) : ())) - : $self->input_tag($name, $value, %attributes, ($cols ? (size => $cols) : ())); + ? $self->textarea_tag($name, $value, %attributes, rows => $rows, cols => $cols) + : $self->input_tag($name, $value, %attributes, size => $cols); } sub multiselect2side { -- 2.20.1