Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 4edfabd2

Von Sven Schöling vor mehr als 13 Jahren hinzugefügt

  • ID 4edfabd24a6c8e2747519c323bd99092bc6fa5a4
  • Vorgänger 0d3d9d8e
  • Nachfolger 2a30958f

checkall attribut in L.checkbox_tag

Unterschiede anzeigen:

SL/Template/Plugin/L.pm
106 106
  $attributes{id}    ||= $self->name_to_id($name);
107 107
  $attributes{value}   = 1 unless defined $attributes{value};
108 108
  my $label            = delete $attributes{label};
109
  my $checkall         = delete $attributes{checkall};
109 110

  
110 111
  if ($attributes{checked}) {
111 112
    $attributes{checked} = 'checked';
......
115 116

  
116 117
  my $code  = $self->html_tag('input', undef,  %attributes, name => $name, type => 'checkbox');
117 118
  $code    .= $self->html_tag('label', $label, for => $attributes{id}) if $label;
119
  $code    .= $self->javascript(qq|\$('#$attributes{id}').checkall('$checkall');|) if $checkall;
118 120

  
119 121
  return $code;
120 122
}
......
578 580
created with said C<label>. No attribute named C<label> is created in
579 581
that case.
580 582

  
583
If C<%attributes> contains a key C<checkall> then the value is taken as a
584
JQuery selector and clicking this checkbox will also toggle all checkboxes
585
matching the selector.
586

  
581 587
=item C<date_tag $name, $value, cal_align =E<gt> $align_code, %attributes>
582 588

  
583 589
Creates a date input field, with an attached javascript that will open a

Auch abrufbar als: Unified diff