Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 1b522616

Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt

Verbesserte Kompatibilität mit Opera, FireFox, InternetExplorer bei Drag & Drop

Wenn Textauswahl mit ".disableSelection()" deaktiviert ist, so kann
man bei den genannten Browsern Text-Eingabefelder nicht mehr
anklicken.

Statt dessen sind nun nur noch die Pfeile drag&drop-bar, der Rest der
Zeile nicht mehr.

Unterschiede anzeigen:

SL/Template/Plugin/L.pm
400 400
  my ($self, $selector, @slurp) = @_;
401 401
  my %params                    = _hashify(@slurp);
402 402

  
403
  my %attributes = ( helper => <<JAVASCRIPT );
403
  my %attributes = ( distance => 5,
404
                     helper   => <<'JAVASCRIPT' );
404 405
    function(event, ui) {
405 406
      ui.children().each(function() {
406
        \$(this).width(\$(this).width());
407
        $(this).width($(this).width());
407 408
      });
408 409
      return ui;
409 410
    }
......
422 423
JAVASCRIPT
423 424
  }
424 425

  
426
  $attributes{handle} = "'$params{handle}'" if $params{handle};
427

  
425 428
  my $attr_str = join(', ', map { "${_}: $attributes{$_}" } keys %attributes);
426 429

  
427 430
  my $code = <<JAVASCRIPT;
428 431
<script type="text/javascript">
429 432
  \$(function() {
430
    \$( "${selector}" ).sortable({ ${attr_str} }).disableSelection();
433
    \$( "${selector}" ).sortable({ ${attr_str} })
431 434
  });
432 435
</script>
433 436
JAVASCRIPT
......
676 679
Sets the POST parameter name for AJAX request after dropping an
677 680
element (see C<$params{with}>).
678 681

  
682
=item C<handle>
683

  
684
An optional jQuery selector specifying which part of the child element
685
is dragable. If nothing is given then the whole child element is
686
dragable, and clicks through to underlying elements like inputs or
687
links might not work.
688

  
679 689
=back
680 690

  
681 691
Example:

Auch abrufbar als: Unified diff