HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/trac/htdocs/js/resizer.js
// Allow resizing <textarea> elements through a drag bar

jQuery(function($) {
  $('textarea.trac-resizable').each(function() {
    var textarea = $(this);
    var offset = null;

    function beginDrag(e) {
      offset = textarea.height() - e.pageY;
      textarea.blur();
      $(document).mousemove(dragging).mouseup(endDrag);
      return false;
    }

    function dragging(e) {
      textarea.height(Math.max(32, offset + e.pageY) + 'px');
      return false;
    }

    function endDrag(e) {
      textarea.focus();
      $(document).off('mousemove', dragging).off('mouseup', endDrag);
    }

    var grip = $('<div class="trac-grip"/>').mousedown(beginDrag)[0];
    textarea.wrap('<div class="trac-resizable"><div></div></div>')
            .parent().append(grip);
    grip.style.marginLeft = (this.offsetLeft - grip.offsetLeft) + 'px';
    grip.style.marginRight = (grip.offsetWidth - this.offsetWidth) +'px';
  });
});