Changeset 11754


Ignore:
Timestamp:
Jul 15, 2011, 9:01:04 PM (13 years ago)
Author:
rvelices
Message:

faster javascript on batch manager page with many pictures

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/themes/default/template/batch_manager_global.tpl

    r11212 r11754  
    429429
    430430jQuery(window).load(function() {
    431   var max_dim = 20;
    432   $(".thumbnails img").each(function () {
    433     if ($(this).height() > (max_dim-20))
    434       max_dim = $(this).height() + 20;
    435     if ($(this).width() > (max_dim-20))
    436       max_dim = $(this).width() + 20;
    437     $("ul.thumbnails span, ul.thumbnails label").css('width', max_dim+'px').css('height', max_dim+'px');
    438   });
     431        var max_dim = 0;
     432        $(".thumbnails img").each(function () {
     433                max_dim = Math.max(max_dim, $(this).height(), $(this).width() );
     434        });
     435        max_dim += 20;
     436        $("ul.thumbnails span, ul.thumbnails label").css('width', max_dim+'px').css('height', max_dim+'px');
    439437});
    440438{/literal}{/footer_script}
Note: See TracChangeset for help on using the changeset viewer.