source: sipes/cord/misc/textarea.js @ b9d4e2e

stableversion-3.0
Last change on this file since b9d4e2e was b354002, checked in by José Gregorio Puentes <jpuentes@…>, 8 años ago

se agrego el directorio del cord

  • Propiedad mode establecida a 100755
File size: 1.2 KB
Línea 
1
2Drupal.behaviors.textarea = function(context) {
3  $('textarea.resizable:not(.textarea-processed)', context).each(function() {
4    // Avoid non-processed teasers.
5    if ($(this).is(('textarea.teaser:not(.teaser-processed)'))) {
6      return false; 
7    }
8    var textarea = $(this).addClass('textarea-processed'), staticOffset = null;
9
10    // When wrapping the text area, work around an IE margin bug.  See:
11    // http://jaspan.com/ie-inherited-margin-bug-form-elements-and-haslayout
12    $(this).wrap('<div class="resizable-textarea"><span></span></div>')
13      .parent().append($('<div class="grippie"></div>').mousedown(startDrag));
14
15    var grippie = $('div.grippie', $(this).parent())[0];
16    grippie.style.marginRight = (grippie.offsetWidth - $(this)[0].offsetWidth) +'px';
17
18    function startDrag(e) {
19      staticOffset = textarea.height() - e.pageY;
20      textarea.css('opacity', 0.25);
21      $(document).mousemove(performDrag).mouseup(endDrag);
22      return false;
23    }
24
25    function performDrag(e) {
26      textarea.height(Math.max(32, staticOffset + e.pageY) + 'px');
27      return false;
28    }
29
30    function endDrag(e) {
31      $(document).unbind("mousemove", performDrag).unbind("mouseup", endDrag);
32      textarea.css('opacity', 1);
33    }
34  });
35};
Nota: Vea TracBrowser para ayuda de uso del navegador del repositorio.