Speed up collapsibles.
authorEarl Miles
Fri, 25 Mar 2011 02:18:17 +0000 (19:18 -0700)
committerEarl Miles
Fri, 25 Mar 2011 02:18:17 +0000 (19:18 -0700)
js/ajax.js

index 969f572..a4eb9b1 100644 (file)
           for (var $parent = $(node); $parent.get(0) != document && $parent.size() != 0; $parent = $parent.parent()) {
             if ($parent.css('overflow') == 'scroll' || $parent.css('overflow') == 'auto') {
               if (Drupal.viewsUi.resizeModal) {
-                Drupal.viewsUi.resizeModal();
+                // If the modal is already at the max height, don't bother with
+                // this since the only reason to do it is to grow the modal.
+                if ($('.views-ui-dialog').height() < parseInt($(window).height() * .8)) {
+                  Drupal.viewsUi.resizeModal();
+                }
               }
               return;
             }