diff options
Diffstat (limited to 'misc/textarea.js')
-rw-r--r-- | misc/textarea.js | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/misc/textarea.js b/misc/textarea.js index d5768154f99..fc98f15448f 100644 --- a/misc/textarea.js +++ b/misc/textarea.js @@ -1,18 +1,26 @@ // $Id$ if (isJsEnabled()) { - addLoadEvent(function() { - // Attach to all visible textareas + addLoadEvent(textAreaInit); +} + +function textAreaInit(parent) { + if (typeof parent == 'undefined') { + // Attach to all visible textareas. textareas = document.getElementsByTagName('textarea'); - var textarea; - for (var i = 0; textarea = textareas[i]; ++i) { - if (hasClass(textarea, 'resizable')) { - if (typeof dimensions(textarea).width != 'undefined' && dimensions(textarea).width != 0) { - new textArea(textarea); - } + } + else { + // Attach to all visible textareas inside parent. + textareas = parent.getElementsByTagName('textarea'); + } + var textarea; + for (var i = 0; textarea = textareas[i]; ++i) { + if (hasClass(textarea, 'resizable') && !hasClass(textarea.nextSibling, 'grippie')) { + if (typeof dimensions(textarea).width != 'undefined' && dimensions(textarea).width != 0) { + new textArea(textarea); } } - }); + } } function textArea(element) { |