Ignore:
Timestamp:
Aug 5, 2012, 4:51:13 PM (12 years ago)
Author:
Zaphod
Message:

version 2.2.7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/stripped/js/scripts-tpp.js

    r14310 r17407  
    174174                        var marge_cote;
    175175
    176                         if (ImageCadre.length == 0) {
    177                                 ImageContainer.css("opacity","1");
    178                                 jQuery("img","#theImageAndTitle").css("opacity","1");
    179                                 return;
    180                         }
    181                        
    182                         if (options.navArrows) {marge_cote=30;} else {marge_cote=10;};
    183 
    184176                        var marge_sup = 5 + Content.offset().top;
    185177                        var marge_inf;
    186178                        if (options.themeStyle == 'original') { marge_inf = options.imageAutosizeMargin+10;} else { marge_inf = 30;};
    187179                        var marge_spec = 0;
     180
     181                        if (ImageCadre.length == 0) {
     182                                ImageContainer.css("opacity","1");
     183                                jQuery("img","#theImageAndTitle").css("opacity","1");
     184                                ImageContainer.css("top",marge_sup+"px");
     185                                //maps & earth
     186                                if (jQuery("#map").length == 1) {
     187                                        ImageContainer.css("position","static");
     188                                        ImageContainer.css("margin-top","10px");
     189                                }
     190                                return;
     191                        }
    188192                       
    189193                        var slideshow=jQuery("#light_slideshow");
     
    361365{
    362366  p = new Object();
     367  imgH = jQuery(document).data("highHeight")
     368  imgW = jQuery(document).data("highWidth")
    363369
    364370  if(zoom=='full')
     
    369375    p.top=options.marginContainer;
    370376
    371     if(p.width>jQuery(document).data("highWidth"))
    372     {
    373       p.width = jQuery(document).data("highWidth")-options.paddingContainer*2;
     377    if(p.width>imgW)
     378    {
     379      p.width = imgW;
    374380      p.left = (jQuery("html").get(0).clientWidth-p.width)/2;
    375     }
    376 
    377     if(p.height>jQuery(document).data("highHeight"))
    378     {
    379       p.height = jQuery(document).data("highHeight")-options.paddingContainer*2;
     381      jQuery("#theImgHighZoomButton").hide();
     382    }
     383
     384    if(p.height>imgH)
     385    {
     386      p.height = imgH;
    380387      p.top = (jQuery("html").get(0).clientHeight-p.height)/2;
    381     }
     388      jQuery("#theImgHighZoomButton").hide();
     389    }
     390       
     391        if ((p.width==imgW) && (p.height==imgH)) switchZoomHigh();
    382392  }
    383393  else
    384394  {
    385395    //zoom = 'fit'
    386     ratioImg = jQuery(document).data("highWidth") / jQuery(document).data("highHeight");
     396        ratioImg = imgW / imgH;
    387397    ratioPage = jQuery("html").get(0).clientWidth / jQuery("html").get(0).clientHeight;
    388398
     
    398408      p.height = p.width/ratioImg;
    399409    }
     410       
     411        if ((p.width > imgW) || (p.height > imgH)) {
     412                p.height = imgH;
     413                p.width = imgW;
     414                jQuery("#theImgHighZoomButton").hide();
     415        }
    400416    p.left = (jQuery("html").get(0).clientWidth-p.width)/2;
    401417    p.top = (jQuery("html").get(0).clientHeight-p.height)/2;
Note: See TracChangeset for help on using the changeset viewer.