summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2008-01-08 19:54:07 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2008-01-08 19:54:07 +0000
commitadf836896a39a7ded85686ca6158f3f889d0f384 (patch)
tree67e3ac7c6231aefd012cf13696c3eaf0e0dd93a0 /misc
parent1ac7418865dde2a0d1f5bfafa9663a88366ca5e0 (diff)
downloadbrdo-adf836896a39a7ded85686ca6158f3f889d0f384.tar.gz
brdo-adf836896a39a7ded85686ca6158f3f889d0f384.tar.bz2
#204756 by dvessel: textarea.js assumed #disabled fields are to be hidden
Diffstat (limited to 'misc')
-rw-r--r--misc/teaser.js11
-rw-r--r--misc/textarea.js11
2 files changed, 9 insertions, 13 deletions
diff --git a/misc/teaser.js b/misc/teaser.js
index 37e31873d..633d39e6c 100644
--- a/misc/teaser.js
+++ b/misc/teaser.js
@@ -70,13 +70,20 @@ Drupal.behaviors.teaser = function(context) {
body[0].value = trim(text[1]);
$(teaser).attr('disabled', '');
$('input', button).val(Drupal.t('Join summary')).toggle(join_teaser, split_teaser);
- $(teaser).show();
}
else {
- $(teaser).hide();
$('input', button).val(Drupal.t('Split summary at cursor')).toggle(split_teaser, join_teaser);
$(checkbox).hide();
}
+ // Make sure that textarea.js has done its magic to ensure proper visibility state.
+ if (Drupal.behaviors.textarea && teaser.is(('.form-textarea:not(.textarea-processed)'))) {
+ Drupal.behaviors.textarea(teaser.parentNode);
+ }
+ // Set initial visibility
+ if ($(teaser).is('[@disabled]')) {
+ $(teaser).parent().hide();
+ }
+
});
};
diff --git a/misc/textarea.js b/misc/textarea.js
index fed9db687..f2c9962d1 100644
--- a/misc/textarea.js
+++ b/misc/textarea.js
@@ -4,22 +4,11 @@ Drupal.behaviors.textarea = function(context) {
$('textarea.resizable:not(.textarea-processed)', context).each(function() {
var textarea = $(this).addClass('textarea-processed'), staticOffset = null;
- // Make sure that teaser.js has done its magic before converting this textarea.
- if (Drupal.behaviors.teaser && textarea.is(('.teaser:not(.teaser-processed)'))) {
- Drupal.behaviors.teaser(this.parentNode);
- }
-
// When wrapping the text area, work around an IE margin bug. See:
// http://jaspan.com/ie-inherited-margin-bug-form-elements-and-haslayout
$(this).wrap('<div class="resizable-textarea"><span></span></div>')
.parent().append($('<div class="grippie"></div>').mousedown(startDrag));
- // Inherit visibility
- if ($(this).is('[@disabled]')) {
- $(this).parent().hide();
- $(this).show();
- }
-
var grippie = $('div.grippie', $(this).parent())[0];
grippie.style.marginRight = (grippie.offsetWidth - $(this)[0].offsetWidth) +'px';