Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 5f68c975

Von Moritz Bunkus vor fast 12 Jahren hinzugefügt

Refactoring: DHTML-Tab-Dialog durch Variante aus jQuery-UI ersetzt

Unterschiede anzeigen:

SL/Template/Plugin/L.pm
464 464

  
465 465
    next if $tab eq '';
466 466

  
467
    my $selected = $params{selected} == $i;
468
    my $tab_id   = "__tab_id_$i";
469
    push @header, $self->li_tag(
470
      $self->link('', $tab->{name}, rel => $tab_id),
471
        ($selected ? (class => 'selected') : ())
472
    );
473
    push @blocks, $self->div_tag($tab->{data},
474
      id => $tab_id, class => 'tabcontent');
467
    my $tab_id = "__tab_id_$i";
468
    push @header, $self->li_tag($self->link('#' . $tab_id, $tab->{name}));
469
    push @blocks, $self->div_tag($tab->{data}, id => $tab_id);
475 470
  }
476 471

  
477 472
  return '' unless @header;
478
  return $self->ul_tag(
479
    join('', @header), id => $id, class => 'shadetabs'
480
  ) .
481
  $self->div_tag(
482
    join('', @blocks), class => 'tabcontentstyle'
483
  ) .
484
  $self->javascript(
485
    qq|var $id = new ddtabcontent("$id");$id.setpersist(true);| .
486
    qq|$id.setselectedClassTarget("link");$id.init();|
487
  );
473

  
474
  my $ul = $self->ul_tag(join('', @header), id => $id);
475
  return $self->div_tag(join('', $ul, @blocks), class => 'tabwidget');
488 476
}
489 477

  
490 478
sub tab {
......
890 878
    L.tab(LxERP.t8('Custom Variables'), 'part/_cvar_tab.html', if => SELF.display_cvar_tab),
891 879
  ]) %]
892 880

  
893
An optional attribute is C<selected>, which accepts the ordinal of a tab which
894
should be selected by default.
895

  
896 881
=item C<areainput_tag $name, $content, %PARAMS>
897 882

  
898 883
Creates a generic input tag or textarea tag, depending on content size. The

Auch abrufbar als: Unified diff