Changeset 19166


Ignore:
Timestamp:
Nov 25, 2012, 11:01:31 AM (8 years ago)
Author:
cljosse
Message:

[extensions] Autosize fix compatibility with 2.4 (Autosize margin )

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Autosize/js/Affiche_script.js

    r19156 r19166  
    491491    //===================
    492492    // options
    493     //===================
    494 
    495493    //=========================================================
    496     /*messages = "This frame uses the W3C box model: <span>" + jQuery.support.boxModel + "</span>";
    497     messages += "This frame uses the html5Clone: <span>" + jQuery.support.html5Clone + "</span>";*/
    498     // jQuery("p").html(messages);
    499494    if (typeof (options) == "undefined") {
    500495      options = { imageAutosize: false }
     
    518513    options.valide = jQuery(".Autosize").css("display") != "none";
    519514    options.marge_haute = jQuery(".Autosize").Get_Val_int(jQuery(".Autosize").css("top"));
    520     options.marge_basse = jQuery(".Autosize").Get_Val_int(jQuery(".Autosize").css("bottom"));
     515  options.marge_basse = Math.max(
     516  jQuery(".Autosize").Get_Val_int(jQuery(".Autosize").css("bottom")),
     517  options.marge_basse
     518  );
     519
    521520    options.marge_gauche = jQuery(".Autosize").Get_Val_int(jQuery(".Autosize").css("left"));
    522521    options.marge_droite = jQuery(".Autosize").Get_Val_int(jQuery(".Autosize").css("right"));
     
    901900        if (options.imageAutosize == true) {
    902901          options.pictureSelType = options.pictureDeriv;
    903         Zone_image.image_init.width = jQuery(theImg).width();
    904         Zone_image.image_init.height = jQuery(theImg).height();
     902          Zone_image.image_init.width = jQuery(theImg).width();
     903          Zone_image.image_init.height = jQuery(theImg).height();
    905904          set_cl("no");
    906905          Set_llbgo(true);
     
    949948        if (options.imageAutosize == false)
    950949          if (options.pictureSelType == "Autosize" || options.pictureSelType == "SelMaxi") {
    951             jQuery(theMainImage_id).height(Zone_image.image.height);
     950            jQuery(theMainImage_id).height(Zone_image.image.height );
    952951            jQuery(theMainImage_id).width(Zone_image.image.width);
     952           
     953            jQuery(theMainImage_id).css("margin-top", options.marge_haute );
    953954
    954955          } else {
     
    17521753      if (!options.check_desc_v)
    17531754        options.marge_bottom_2 = 0;
    1754       else
    1755         options.marge_bottom = 0;
     1755     
    17561756
    17571757      marge_bottom = options.marge_bottom_2 + options.marge_bottom;
     
    18321832      options.theImageRight = (new_win.width - new_dim.right);
    18331833      options.marge_bottom_2 = Math.ceil(new_dim.out.bottom - new_img.out.bottom);
     1834
    18341835      if (Type_Img == "iframe") { }
    18351836      new_dim.out.bottom = new_win.height - options.marge_bottom_2;
     
    18371838      options.theImageBottom = new_win.height - new_dim.out.bottom;
    18381839      if (options.slideshow) {
    1839 
    18401840        options.marge_top = 0;
    18411841      } else {
    1842         options.marge_top = Math.ceil(new_img.top - new_dim.top);
     1842        options.marge_top_2 = Math.ceil(new_img.top - new_dim.top) + options.marge_top;
    18431843      }
    18441844
     
    18461846        options.theImageBottom_2 = 0;
    18471847      }
     1848
    18481849      options.theImageWidth = new_win.width - options.theImageLeft - options.theImageRight;
    18491850      options.theImageHeight = new_win.height - options.marge_top - options.theImageBottom - options.theImageTop;
     
    22732274
    22742275
    2275   });                                                                                                               // ready
     2276  });                                                                                                                // ready
    22762277
    22772278
Note: See TracChangeset for help on using the changeset viewer.