diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-09-11 02:01:26 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-09-11 02:01:26 +0000 |
commit | f6528ec8a5233f4b39daaf8aa94aa2b9b90c3002 (patch) | |
tree | 54dc34ac391aea248a7baf8f4787e6bb86bb41e5 | |
parent | 53b9e820d3be8c2585862106f7c0defe06de8b25 (diff) | |
download | brdo-f6528ec8a5233f4b39daaf8aa94aa2b9b90c3002.tar.gz brdo-f6528ec8a5233f4b39daaf8aa94aa2b9b90c3002.tar.bz2 |
#572872 by cwgordon7: Fixed coding style problems in collapse.js.
-rw-r--r-- | misc/collapse.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/misc/collapse.js b/misc/collapse.js index 741f4b0ba..9e1e1d1b9 100644 --- a/misc/collapse.js +++ b/misc/collapse.js @@ -2,7 +2,7 @@ (function ($) { /** - * Toggle the visibility of a fieldset using smooth animations + * Toggle the visibility of a fieldset using smooth animations. */ Drupal.toggleFieldset = function (fieldset) { if ($(fieldset).is('.collapsed')) { @@ -20,7 +20,7 @@ Drupal.toggleFieldset = function (fieldset) { $('div.action', fieldset).show(); }, step: function () { - // Scroll the fieldset into view + // Scroll the fieldset into view. Drupal.collapseScrollIntoView(this.parentNode); } }); @@ -45,7 +45,8 @@ Drupal.collapseScrollIntoView = function (node) { if (posY + node.offsetHeight + fudge > h + offset) { if (node.offsetHeight > h) { window.scrollTo(0, posY); - } else { + } + else { window.scrollTo(0, posY + node.offsetHeight - h + fudge); } } @@ -55,7 +56,7 @@ Drupal.behaviors.collapse = { attach: function (context, settings) { $('fieldset.collapsible > legend', context).once('collapse', function () { var fieldset = $(this.parentNode); - // Expand if there are errors inside + // Expand if there are errors inside. if ($('input.error, textarea.error, select.error', fieldset).size() > 0) { fieldset.removeClass('collapsed'); } @@ -68,12 +69,12 @@ Drupal.behaviors.collapse = { }) .trigger('summaryUpdated'); - // Turn the legend into a clickable link and wrap the contents of the fieldset - // in a div for easier animation + // 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 () { var fieldset = $(this).parents('fieldset:first')[0]; - // Don't animate multiple times + // Don't animate multiple times. if (!fieldset.animating) { fieldset.animating = true; Drupal.toggleFieldset(fieldset); |