summaryrefslogtreecommitdiffstatshomepage
path: root/misc
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
parent8fe50513608c519f36ee42f658f431ca628d9c9e (diff)
downloaddrupal-39c261909f7ad0b3a22b49607132f86de3228fea.tar.gz
drupal-39c261909f7ad0b3a22b49607132f86de3228fea.zip
#57750: Resizable textareas in collapsible fieldsets
Diffstat (limited to 'misc')
-rw-r--r--misc/collapse.js4
-rw-r--r--misc/textarea.js26
2 files changed, 21 insertions, 9 deletions
diff --git a/misc/collapse.js b/misc/collapse.js
index 387bf376fc2..e6905ac087e 100644
--- a/misc/collapse.js
+++ b/misc/collapse.js
@@ -22,6 +22,10 @@ function collapseAutoAttach() {
toggleClass(this.parentNode.parentNode, 'collapsed');
if (!hasClass(this.parentNode.parentNode, 'collapsed')) {
collapseScrollIntoView(this.parentNode.parentNode);
+ if (typeof textAreaInit != 'undefined') {
+ // Add the grippie to a textarea in a collapsed fieldset.
+ textAreaInit(this.parentNode.parentNode);
+ }
}
this.blur();
return false;
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) {