Ignore:
Timestamp:
Jan 26, 2011, 6:42:36 PM (13 years ago)
Author:
cljosse
Message:

[cl_conflit] script compatibility with piwigo 2.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/cl_conflit/js/jquery.dimensions.js

    r8740 r8926  
    5858            }) : this[0] == window || this[0] == document ? self[(name == 'Left' ? 'pageXOffset' : 'pageYOffset')] || jQuery.boxModel && document.documentElement['scroll' + name] || document.body['scroll' + name] : this[0]['scroll' + name];
    5959        };
     60        //================================================
     61        jQuery.fn['absolute' + name] = function (val) {
     62            if (!this[0]) return;
     63                       a = jQuery(this[0]);
     64            m = 0;
     65            while (a.length > 0) {
     66                val = jQuery(a).infos();
     67                if (val.position != "absolute") {
     68                    m += name == 'Left' ? val.left : val.top;
     69                    m += name == 'Left' ? val.margin.left : val.margin.top;
     70                    m += name == 'Left' ? val.margin.right : val.margin.bottom;
     71                    m += name == 'Left' ? val.borderwidth.left : val.borderwidth.top;
     72                 //   m += name == 'Left' ? val.borderwidth.right : val.borderwidth.bottom;
     73                 //   m += name == 'Left' ? val.padding.left : val.padding.top;
     74                 //   m += name == 'Left' ? val.padding.right : val.padding.bottom;
     75                     a = jQuery(a).offsetParent();
     76                } else
     77                    break;
     78
     79            }
     80            //306
     81
     82
     83            return m;
     84
     85
     86        };
     87
    6088
    6189    });
     90    //=====================================================
    6291    jQuery.fn.extend({
    6392
     
    106135                if (elem.nodeName) nodeName = elem.nodeName;
    107136
    108                
     137
    109138                if (elem == window) {
    110139
     
    113142                    height = jQuery(elem).height();
    114143                } else {
     144
    115145                    Css = jQuery(elem).getStyles(elem);
    116146                    myposition = Css.position || "";
     
    135165                    margin.top = jQuery(elem).Get_Val_int(Css.marginTop, "", "", 'marginTop');
    136166                    margin.bottom = jQuery(elem).Get_Val_int(Css.marginBottom, "", "", 'marginBottom');
     167
     168
    137169                    try {
    138170                        margin.margin = Css.margin;
     
    146178                    padding.top = jQuery(elem).Get_Val_int(Css.paddingTop, "", "", 'paddingTop');
    147179                    padding.bottom = jQuery(elem).Get_Val_int(Css.paddingBottom, "", "", 'paddingBottom');
     180
    148181                    try {
    149182                        padding.padding = Css.padding;
     
    155188                    Cl_Position = { Top: 0, Left: 0 };
    156189                } else {
    157                     Cl_Position = jQuery(elem).position();
     190                    Cl_Position = jQuery(elem).d_position();
    158191                }
    159192                Left = Cl_Position.left;
     
    181214        * Cl_Position de l'object elem
    182215        */
    183         position: function () {
     216        d_position: function () {
    184217            var left = 0, top = 0, elem = this[0], offset, parentOffset, offsetParent, results;
    185218
     
    249282        Get_Val_int: function (myObj, Maxi_val, Mini_val, prop) {
    250283            var val = 0;
    251 
    252284            Maxi_val = parseInt(Maxi_val || "0");
    253285
Note: See TracChangeset for help on using the changeset viewer.