diff --git a/misc/collapse.js b/misc/collapse.js old mode 100755 new mode 100644 index 512ff2f..826ef2f --- a/misc/collapse.js +++ b/misc/collapse.js @@ -15,12 +15,7 @@ Drupal.toggleFieldset = function (fieldset) { duration: 'fast', easing: 'linear', complete: function () { - Drupal.collapseScrollIntoView(fieldset); fieldset.animating = false; - }, - step: function () { - // Scroll the fieldset into view. - Drupal.collapseScrollIntoView(fieldset); } }); } @@ -35,24 +30,6 @@ Drupal.toggleFieldset = function (fieldset) { } }; -/** - * Scroll a given fieldset into view as much as possible. - */ -Drupal.collapseScrollIntoView = function (node) { - var h = document.documentElement.clientHeight || document.body.clientHeight || 0; - var offset = document.documentElement.scrollTop || document.body.scrollTop || 0; - var posY = $(node).offset().top; - var fudge = 55; - if (posY + node.offsetHeight + fudge > h + offset) { - if (node.offsetHeight > h) { - window.scrollTo(0, posY); - } - else { - window.scrollTo(0, posY + node.offsetHeight - h + fudge); - } - } -}; - Drupal.behaviors.collapse = { attach: function (context, settings) { $('fieldset.collapsible', context).once('collapse', function () {