| 1 | package HTML::FormHandler::Field::RmElement; | ||||||||||||||||||||
| 2 | # ABSTRACT: field to support repeatable javascript remove | ||||||||||||||||||||
| 3 | 1 | $HTML::FormHandler::Field::RmElement::VERSION = '0.410002'; | |||||||||||||||||||
| 4 | 1 | ▶ | use HTML::FormHandler::Moose; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 1 | extends 'HTML::FormHandler::Field::Display'; | |||||||||||||||||||
| 6 | 1 | ▶ | use HTML::FormHandler::Render::Util ('process_attrs'); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | 1 | has '+do_wrapper' => ( default => 1 ); | |||||||||||||||||||
| 10 | 1 | has '+value' => ( default => 'Remove' ); | |||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | 2 | ▶ | sub build_render_method { | ||||||||||||||||||
|
Subroutine
build_render_method: called CC=1 SCAR=0.1
Pod
undocumented
| |||||||||||||||||||||
| 13 | 2 | ▶ | return sub { | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=4 SCAR=14.4
| |||||||||||||||||||||
| 14 | 2 | my ( $self, $result ) = @_; | |||||||||||||||||||
| 15 | 2 | ▶ | $result ||= $self->result; | ||||||||||||||||||
|
Condition33%1/3
$result ||= $self->result
MC/DC0%0/2
$result ||= $self->result
$result
$self->result
Truth table33%1/3
A ||= B
A= $resultB= $self->result
| |||||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | 2 | ▶ | my $value = $self->html || $self->html_filter($self->_localize($self->value)); | ||||||||||||||||||
|
Condition33%1/3
$self->html || $self->html_filter($self->_localize($self->value))
MC/DC0%0/2
$self->html || $self->html_filter($self->_localize($self->value))
$self->html
$self->html_filter($self->_localize($self->value))
Truth table33%1/3
A || B
A= $self->htmlB= $self->html_filter($self->_localize($self->value))
| |||||||||||||||||||||
| 18 | 2 | my $attrs = $self->element_attributes($result); | |||||||||||||||||||
| 19 | 2 | push @{$attrs->{class}}, ( 'rm_element', 'btn' ); | |||||||||||||||||||
| 20 | 2 | $attrs->{'data-rep-elem-id'} = $self->parent->id; | |||||||||||||||||||
| 21 | 2 | $attrs->{id} = $self->id; | |||||||||||||||||||
| 22 | 2 | my $attr_str = process_attrs($attrs); | |||||||||||||||||||
| 23 | 2 | ▶ | my $wrapper_tag = $self->get_tag('wrapper_tag') || 'div'; | ||||||||||||||||||
|
Condition50%1/2
$self->get_tag('wrapper_tag') || 'div'
MC/DC0%0/1
$self->get_tag('wrapper_tag') || 'div'
$self->get_tag('wrapper_tag')
Truth table50%1/2
A
A= $self->get_tag('wrapper_tag')
| |||||||||||||||||||||
| 24 | 2 | my $output = qq{<$wrapper_tag$attr_str>$value</$wrapper_tag>}; | |||||||||||||||||||
| 25 | 2 | $output = $self->wrap_field($self->result, $output); | |||||||||||||||||||
| 26 | 2 | return $output; | |||||||||||||||||||
| 27 | 2 | }; | |||||||||||||||||||
| 28 | } | ||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | 1 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||
| 31 | 1 | 1; | |||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | __END__ | ||||||||||||||||||||