summaryrefslogtreecommitdiff
path: root/misc/collapse.js
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-04-27 20:19:38 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-04-27 20:19:38 +0000
commitfc7283235bb9e5ae4300714d03c0bf3723f4792b (patch)
tree0dc443ba5dc1f74fbfc5ad5762c7c7a556232b73 /misc/collapse.js
parent031ba7d66533b3bb6e1ceb1cc834e9af9b1a3c71 (diff)
downloadbrdo-fc7283235bb9e5ae4300714d03c0bf3723f4792b.tar.gz
brdo-fc7283235bb9e5ae4300714d03c0bf3723f4792b.tar.bz2
#444402 follow-up by kkaefer: Fix autocomplete, enforce code style for anonymous JS functions.
Diffstat (limited to 'misc/collapse.js')
-rw-r--r--misc/collapse.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/misc/collapse.js b/misc/collapse.js
index 4c07506df..c4fac9be3 100644
--- a/misc/collapse.js
+++ b/misc/collapse.js
@@ -1,10 +1,10 @@
// $Id$
-(function($) {
+(function ($) {
/**
* Toggle the visibility of a fieldset using smooth animations
*/
-Drupal.toggleFieldset = function(fieldset) {
+Drupal.toggleFieldset = function (fieldset) {
if ($(fieldset).is('.collapsed')) {
// Action div containers are processed separately because of a IE bug
// that alters the default submit button behavior.
@@ -14,12 +14,12 @@ Drupal.toggleFieldset = function(fieldset) {
content.slideDown({
duration: 'fast',
easing: 'linear',
- complete: function() {
+ complete: function () {
Drupal.collapseScrollIntoView(this.parentNode);
this.parentNode.animating = false;
$('div.action', fieldset).show();
},
- step: function() {
+ step: function () {
// Scroll the fieldset into view
Drupal.collapseScrollIntoView(this.parentNode);
}
@@ -27,7 +27,7 @@ Drupal.toggleFieldset = function(fieldset) {
}
else {
$('div.action', fieldset).hide();
- var content = $('> div:not(.action)', fieldset).slideUp('fast', function() {
+ var content = $('> div:not(.action)', fieldset).slideUp('fast', function () {
$(this.parentNode).addClass('collapsed');
this.parentNode.animating = false;
});
@@ -37,7 +37,7 @@ Drupal.toggleFieldset = function(fieldset) {
/**
* Scroll a given fieldset into view as much as possible.
*/
-Drupal.collapseScrollIntoView = function(node) {
+Drupal.collapseScrollIntoView = function (node) {
var h = self.innerHeight || document.documentElement.clientHeight || $('body')[0].clientHeight || 0;
var offset = self.pageYOffset || document.documentElement.scrollTop || $('body')[0].scrollTop || 0;
var posY = $(node).offset().top;
@@ -52,8 +52,8 @@ Drupal.collapseScrollIntoView = function(node) {
};
Drupal.behaviors.collapse = {
- attach: function(context, settings) {
- $('fieldset.collapsible > legend:not(.collapse-processed)', context).each(function() {
+ attach: function (context, settings) {
+ $('fieldset.collapsible > legend:not(.collapse-processed)', context).each(function () {
var fieldset = $(this.parentNode);
// Expand if there are errors inside
if ($('input.error, textarea.error, select.error', fieldset).size() > 0) {
@@ -62,7 +62,7 @@ Drupal.behaviors.collapse = {
var summary = $('<span class="summary"></span>');
fieldset.
- bind('summaryUpdated', function() {
+ bind('summaryUpdated', function () {
var text = $.trim(fieldset.getSummary());
summary.html(text ? ' (' + text + ')' : '');
})
@@ -71,7 +71,7 @@ Drupal.behaviors.collapse = {
// Turn the legend into a clickable link and wrap the contents of the fieldset
// in a div for easier animation
var text = this.innerHTML;
- $(this).empty().append($('<a href="#">' + text + '</a>').click(function() {
+ $(this).empty().append($('<a href="#">' + text + '</a>').click(function () {
var fieldset = $(this).parents('fieldset:first')[0];
// Don't animate multiple times
if (!fieldset.animating) {