Theme selector: controls height now (limits box to height of screen minus a few px of padding) if there are lots of themes
authorDan
Mon, 13 Apr 2009 12:05:46 -0400
changeset 903 b8db9a7946fc
parent 902 e7c6f1aa7b6a
child 904 10076b28194b
Theme selector: controls height now (limits box to height of screen minus a few px of padding) if there are lots of themes
includes/clientside/static/ajax.js
--- a/includes/clientside/static/ajax.js	Sun Apr 12 19:50:58 2009 -0400
+++ b/includes/clientside/static/ajax.js	Mon Apr 13 12:05:46 2009 -0400
@@ -760,7 +760,7 @@
   $.get(stdAjaxPrefix + '&_mode=theme_list', {}, function(data, status)
     {
       $('#theme-selector-inner .theme-selector-spinner').fadeOut(650);
-      $('#theme-selector-body').animate({ width: 708 }, 600, function()
+      $('#theme-selector-body').animate({ width: 728 }, 600, function()
         {
           // avoiding jQuery's fade functions because they insist on toggling display as well
           if ( !aclDisableTransitionFX )
@@ -771,7 +771,12 @@
           for ( var i = 0; i < data.length; i++ )
           {
             var bgi = data[i].have_thumb ? cdnPath + '/themes/' + data[i].theme_id + '/preview.png' : cdnPath + '/images/themepreview.png';
-            $('#theme-selector-inner > ul').append('<li id="theme_' + i + '"><a href="#"><span></span></a></li>');
+            var maxheight = getHeight() - 325;
+            $('#theme-selector-inner > ul')
+              .css('clip', 'rect(0px, auto, auto, 0px)')
+              .css('overflow', 'auto')
+              .css('max-height', maxheight)
+              .append('<li id="theme_' + i + '"><a href="#"><span></span></a></li>');
             $('#theme-selector-inner li#theme_' + i + ' > a')
               .css('background-image', 'url(' + bgi + ')')
               .attr('enano:theme_id', data[i].theme_id);