summaryrefslogtreecommitdiffstatshomepage
path: root/misc/textarea.js
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2006-04-12 16:07:39 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2006-04-12 16:07:39 +0000
commit39c261909f7ad0b3a22b49607132f86de3228fea (patch)
tree9b7a7b455cf7277353db0b8a4142487a072ec895 /misc/textarea.js
parent8fe50513608c519f36ee42f658f431ca628d9c9e (diff)
downloaddrupal-39c261909f7ad0b3a22b49607132f86de3228fea.tar.gz
drupal-39c261909f7ad0b3a22b49607132f86de3228fea.zip
#57750: Resizable textareas in collapsible fieldsets
Diffstat (limited to 'misc/textarea.js')
-rw-r--r--misc/textarea.js26
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) {