diff options
author | rvelices <rv-github@modusoptimus.com> | 2008-08-28 01:26:26 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2008-08-28 01:26:26 +0000 |
commit | 3a67845aaf128fe718b27a89635fb33810ba7e41 (patch) | |
tree | cc12790366983d2c7496bbbf5eb5de5ac2b3b6a8 /template-common/lib/jquery.dimensions.js | |
parent | abb2f22b2e96a89a44ad9d36db3bf612c6f88b9f (diff) |
- removed and moved (from common to admin) some CSS rules
- upgraded jQuery and accordion to latest version (and reorganised a bit their location)
git-svn-id: http://piwigo.org/svn/trunk@2489 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'template-common/lib/jquery.dimensions.js')
-rw-r--r-- | template-common/lib/jquery.dimensions.js | 116 |
1 files changed, 0 insertions, 116 deletions
diff --git a/template-common/lib/jquery.dimensions.js b/template-common/lib/jquery.dimensions.js deleted file mode 100644 index 3dd7a5c8d..000000000 --- a/template-common/lib/jquery.dimensions.js +++ /dev/null @@ -1,116 +0,0 @@ -/* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net) - * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) - * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. - * - * $LastChangedDate$ - * $Rev$ - * - * Version: @VERSION - * - * Requires: jQuery 1.2+ - */ - -(function($){ - -$.dimensions = { - version: '@VERSION' -}; - -// Create innerHeight, innerWidth, outerHeight and outerWidth methods -$.each( [ 'Height', 'Width' ], function(i, name){ - - // innerHeight and innerWidth - $.fn[ 'inner' + name ] = function() { - if (!this[0]) return; - - var torl = name == 'Height' ? 'Top' : 'Left', // top or left - borr = name == 'Height' ? 'Bottom' : 'Right'; // bottom or right - - return num( this, name.toLowerCase() ) + num(this, 'padding' + torl) + num(this, 'padding' + borr); - }; - - // outerHeight and outerWidth - $.fn[ 'outer' + name ] = function(options) { - if (!this[0]) return; - - var torl = name == 'Height' ? 'Top' : 'Left', // top or left - borr = name == 'Height' ? 'Bottom' : 'Right'; // bottom or right - - options = $.extend({ margin: false }, options || {}); - - return num( this, name.toLowerCase() ) - + num(this, 'border' + torl + 'Width') + num(this, 'border' + borr + 'Width') - + num(this, 'padding' + torl) + num(this, 'padding' + borr) - + (options.margin ? (num(this, 'margin' + torl) + num(this, 'margin' + borr)) : 0); - }; -}); - -// Create scrollLeft and scrollTop methods -$.each( ['Left', 'Top'], function(i, name) { - $.fn[ 'scroll' + name ] = function(val) { - if (!this[0]) return; - - return val != undefined ? - - // Set the scroll offset - this.each(function() { - this == window || this == document ? - window.scrollTo( - name == 'Left' ? val : $(window)[ 'scrollLeft' ](), - name == 'Top' ? val : $(window)[ 'scrollTop' ]() - ) : - this[ 'scroll' + name ] = val; - }) : - - // Return the scroll offset - this[0] == window || this[0] == document ? - self[ (name == 'Left' ? 'pageXOffset' : 'pageYOffset') ] || - $.boxModel && document.documentElement[ 'scroll' + name ] || - document.body[ 'scroll' + name ] : - this[0][ 'scroll' + name ]; - }; -}); - -$.fn.extend({ - position: function() { - var left = 0, top = 0, elem = this[0], offset, parentOffset, offsetParent, results; - - if (elem) { - // Get *real* offsetParent - offsetParent = this.offsetParent(); - - // Get correct offsets - offset = this.offset(); - parentOffset = offsetParent.offset(); - - // Subtract element margins - offset.top -= num(elem, 'marginTop'); - offset.left -= num(elem, 'marginLeft'); - - // Add offsetParent borders - parentOffset.top += num(offsetParent, 'borderTopWidth'); - parentOffset.left += num(offsetParent, 'borderLeftWidth'); - - // Subtract the two offsets - results = { - top: offset.top - parentOffset.top, - left: offset.left - parentOffset.left - }; - } - - return results; - }, - - offsetParent: function() { - var offsetParent = this[0].offsetParent; - while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && $.css(offsetParent, 'position') == 'static') ) - offsetParent = offsetParent.offsetParent; - return $(offsetParent); - } -}); - -function num(el, prop) { - return parseInt($.css(el.jquery?el[0]:el,prop))||0; -}; - -})(jQuery);
\ No newline at end of file |