mirror of
https://github.com/tag1consulting/d7_to_d10_migration.git
synced 2025-09-06 09:01:23 +00:00
Initial commit
This commit is contained in:
commit
c5e731d8ae
2773 changed files with 600767 additions and 0 deletions
32
drupal7/web/misc/textarea.js
Normal file
32
drupal7/web/misc/textarea.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
(function ($) {
|
||||
|
||||
Drupal.behaviors.textarea = {
|
||||
attach: function (context, settings) {
|
||||
$('.form-textarea-wrapper.resizable', context).once('textarea', function () {
|
||||
var staticOffset = null;
|
||||
var textarea = $(this).addClass('resizable-textarea').find('textarea');
|
||||
var grippie = $('<div class="grippie"></div>').mousedown(startDrag);
|
||||
|
||||
grippie.insertAfter(textarea);
|
||||
|
||||
function startDrag(e) {
|
||||
staticOffset = textarea.height() - e.pageY;
|
||||
textarea.css('opacity', 0.25);
|
||||
$(document).mousemove(performDrag).mouseup(endDrag);
|
||||
return false;
|
||||
}
|
||||
|
||||
function performDrag(e) {
|
||||
textarea.height(Math.max(32, staticOffset + e.pageY) + 'px');
|
||||
return false;
|
||||
}
|
||||
|
||||
function endDrag(e) {
|
||||
$(document).unbind('mousemove', performDrag).unbind('mouseup', endDrag);
|
||||
textarea.css('opacity', 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery);
|
Loading…
Add table
Add a link
Reference in a new issue