Server : Apache System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64 User : dh_edsupp ( 6597262) PHP Version : 8.2.26 Disable Function : NONE Directory : /lib/python3/dist-packages/trac/htdocs/js/ |
Upload File : |
// 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'; }); });