| 1 | use warnings; | ||
| 2 | use strict; | ||
| 3 | |||
| 4 | package Jifty::Web::Form::Field::Text; | ||
| 5 | use base qw/Jifty::Web::Form::Field/; | ||
| 6 | |||
| 7 | =head1 NAME | ||
| 8 | |||
| 9 | Jifty::Web::Form::Field::Text - Renders as a small text field | ||
| 10 | |||
| 11 | =head1 METHODS | ||
| 12 | |||
| 13 | =cut | ||
| 14 | |||
| 15 | our $VERSION = 1; | ||
| 16 | |||
| 17 | =head2 classes | ||
| 18 | |||
| 19 | Output text fields with the class 'text' | ||
| 20 | |||
| 21 | =cut | ||
| 22 | |||
| 23 | sub classes { | ||
| 24 | my $self = shift; | ||
| 25 | return join(' ', 'text', ($self->SUPER::classes)); | ||
| 26 | } | ||
| 27 | |||
| 28 | |||
| 29 | =head2 handler_allowed HANDLER_NAME | ||
| 30 | |||
| 31 | Returns 1 if the handler (e.g. onclick) is allowed. Undef otherwise. | ||
| 32 | |||
| 33 | =cut | ||
| 34 | |||
| 35 | sub handler_allowed { | ||
| 36 | my $self = shift; | ||
| 37 | my ($handler) = @_; | ||
| 38 | |||
| 39 | return $self->SUPER::handler_allowed($handler) || | ||
| 40 | {onselect => 1}->{$handler}; | ||
| 41 | |||
| 42 | } | ||
| 43 | |||
| 44 | |||
| 45 | 1; |