Skip to content

Commit

Permalink
Allow input_append_button to take input_append_button_element_class
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Hallows authored and Phil Hallows committed Jun 22, 2016
1 parent ab603cf commit f7a2b02
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/HTML/FormHandler/Widget/Wrapper/Bootstrap3.pm
Expand Up @@ -185,10 +185,12 @@ sub do_prepend_append {
push @class, 'input-group';
}
if ( my $iab_tag = $self->get_tag('input_append_button') ) {
my $iab_element_class_tag = $self->get_tag('input_append_button_element_class');
my $classes = join(' ', ref $iab_element_class_tag eq 'ARRAY' ? @$iab_element_class_tag : ($iab_element_class_tag));
my @buttons = ref $iab_tag eq 'ARRAY' ? @$iab_tag : ($iab_tag);
my $group = qq{<span class="input-group-btn">};
foreach my $btn ( @buttons ) {
$group .= qq{<button type="button" class="btn">$btn</button>};
$group .= qq{<button type="button" class="btn $classes">$btn</button>};
}
$group .= qq{</span>};
$rendered_widget = qq{$rendered_widget$group};
Expand Down

0 comments on commit f7a2b02

Please sign in to comment.