Ignore:
Timestamp:
Nov 15, 2012, 11:21:22 AM (11 years ago)
Author:
cljosse
Message:

[extensions] Autosize fix compatibility with 2.4 (compatibility charlie's,iframe )

File:
1 edited

Legend:

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

    r19021 r19030  
    164164    //====================================
    165165    set_cl = function (Valid) {
     166
    166167      if (typeof Valid == "undefined") Valid = options.pictureSelType.match(RegExp("Autosize", "gi")) || false;
    167168      if (typeof options.cl_visible == "undefined") return;
     
    190191
    191192      }
     193
    192194      if ((typeof Zone_image != "undefined") && typeof Zone_image.image != "undefined") {
    193195        Zone_image.zoom = (Zone_image.image.height / Zone_image.image_init.height);
     
    201203          }
    202204        }
     205        if (Type_Img == "pamoorama" || Type_Img == "iframe" || Type_Img == "charlie") {
     206          zoom_cl = "";
     207          src_info = "";
     208          src = src2;
     209        }
     210
    203211        jQuery('#bp_cla').attr('alt', src_info);
    204212        jQuery('#bp_cla').attr('title', src_info);
     
    573581      options.pictureDeriv = pictureDeriv;
    574582    }
    575     if (Type_Img == "pamoorama")
     583    if (Type_Img == "pamoorama" || Type_Img == "iframe" || Type_Img == "charlie") {
    576584      options.pictureSelType = "Autosize";
     585    }
    577586    for (i = 0; i < options.liste_type.length; i++) {
    578587      options.liste_type[i] = options.liste_type[i].split(",");
     
    600609
    601610        patname = href_path.replace("javascript\:", "");
     611       if(typeof old_path == "undefined") old_path = patname;
    602612        pt = pt.split(",");
    603613        tsz = pt[pt.length - 1];
     
    934944
    935945        if (Type_Img == "charlie" || Type_Img == "iframe") {
     946          init_w1 = Zone_image.image.width;
     947          init_h1 = Zone_image.image.height;
     948
     949          if (pictureSelType_user != "Autosize" && pictureSelType_user != "SelMaxi") {
     950            init_w1 = Autosize_options.ideal_size_width;
     951            init_h1 = Autosize_options.ideal_size_height;
     952          }
    936953          if (Type_Img == "charlie") {
    937954            dp1 = jQuery("#charlie").offset();
     
    941958                wpng = Math.abs(dp.left - dp1.left) * 2;
    942959            }
    943             png_h = jQuery("#" + Type_Img + " div").height();
    944             w01 = Math.ceil(jQuery("#" + "theImage").width() - wpng);
     960            png_h = init_h1;
     961            w01 = init_w1 - wpng;
     962
    945963            jQuery("#" + "theImage").css({ padding: 0 });
    946964            if (!png_h) {
     
    969987            }
    970988            jQuery("#" + Type_Img).height(png_h);
    971 
    972 
    973989            jQuery("#" + Type_Img + " div").width(w01);
    974 
    975 
    976 
     990            jQuery("#theImage").css({ height: "auto" });
    977991          } else {
    978992            jQuery("#theImage").css({ height: "auto" });
    979993            jQuery("#theMainImage").css({ width: "auto", height: "auto" });
    980             jQuery("#" + Type_Img).attr("width", Zone_image.image.width - (infos_theMainImage.borderwidth.left + infos_theMainImage.borderwidth.right));
    981             jQuery("#" + Type_Img).attr("height", Zone_image.image.height - (infos_theMainImage.borderwidth.top + infos_theMainImage.borderwidth.bottom));
     994            jQuery("#" + Type_Img).attr("width", init_w1 - (infos_theMainImage.borderwidth.left + infos_theMainImage.borderwidth.right));
     995            jQuery("#" + Type_Img).attr("height", init_h1 - (infos_theMainImage.borderwidth.top + infos_theMainImage.borderwidth.bottom));
    982996          }
    983997          jQuery("#" + Type_Img).show(options.fade_in);
     
    22442258
    22452259
    2246   });                                                                                           // ready
     2260  });                                                                                                     // ready
    22472261
    22482262
Note: See TracChangeset for help on using the changeset viewer.