summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 387bf376f..e6905ac08 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 d5768154f..fc98f1544 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) {