From d15d220256f249ad4af1a0bf7d4b95e9e5edd8b1 Mon Sep 17 00:00:00 2001 From: rvelices Date: Fri, 15 Jul 2011 19:01:04 +0000 Subject: faster javascript on batch manager page with many pictures git-svn-id: http://piwigo.org/svn/trunk@11754 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/themes/default/template/batch_manager_global.tpl | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'admin/themes/default/template') diff --git a/admin/themes/default/template/batch_manager_global.tpl b/admin/themes/default/template/batch_manager_global.tpl index 3f283e70e..f1e722e35 100644 --- a/admin/themes/default/template/batch_manager_global.tpl +++ b/admin/themes/default/template/batch_manager_global.tpl @@ -428,14 +428,12 @@ $(document).ready(function() { }); jQuery(window).load(function() { - var max_dim = 20; - $(".thumbnails img").each(function () { - if ($(this).height() > (max_dim-20)) - max_dim = $(this).height() + 20; - if ($(this).width() > (max_dim-20)) - max_dim = $(this).width() + 20; - $("ul.thumbnails span, ul.thumbnails label").css('width', max_dim+'px').css('height', max_dim+'px'); - }); + var max_dim = 0; + $(".thumbnails img").each(function () { + max_dim = Math.max(max_dim, $(this).height(), $(this).width() ); + }); + max_dim += 20; + $("ul.thumbnails span, ul.thumbnails label").css('width', max_dim+'px').css('height', max_dim+'px'); }); {/literal}{/footer_script} -- cgit v1.2.3