[ Index ]
 

Code source de Drupal 5.3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/misc/ -> textarea.js (source)

   1  // $Id: textarea.js,v 1.11.2.1 2007/04/18 02:41:19 drumm Exp $
   2  
   3  Drupal.textareaAttach = function() {
   4    $('textarea.resizable:not(.processed)').each(function() {
   5      var textarea = $(this).addClass('processed'), staticOffset = null;
   6  
   7      // When wrapping the text area, work around an IE margin bug.  See:
   8      // http://jaspan.com/ie-inherited-margin-bug-form-elements-and-haslayout
   9      $(this).wrap('<div class="resizable-textarea"><span></span></div>')
  10        .parent().append($('<div class="grippie"></div>').mousedown(startDrag));
  11  
  12      var grippie = $('div.grippie', $(this).parent())[0];
  13      grippie.style.marginRight = (grippie.offsetWidth - $(this)[0].offsetWidth) +'px';
  14  
  15      function startDrag(e) {
  16        staticOffset = textarea.height() - Drupal.mousePosition(e).y;
  17        textarea.css('opacity', 0.25);
  18        $(document).mousemove(performDrag).mouseup(endDrag);
  19        return false;
  20      }
  21  
  22      function performDrag(e) {
  23        textarea.height(Math.max(32, staticOffset + Drupal.mousePosition(e).y) + 'px');
  24        return false;
  25      }
  26  
  27      function endDrag(e) {
  28        $(document).unmousemove(performDrag).unmouseup(endDrag);
  29        textarea.css('opacity', 1);
  30      }
  31    });
  32  }
  33  
  34  if (Drupal.jsEnabled) {
  35    $(document).ready(Drupal.textareaAttach);
  36  }


Généré le : Fri Nov 30 16:20:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics