Sha256: af5a46e2174eb7ad0e0ff256bb7654897630861aae34e39655dbd09e8f30f1c9

Contents?: true

Size: 1.74 KB

Versions: 160

Compression:

Stored size: 1.74 KB

Contents

define( [
	"./core",
	"./core/access",
	"./css"
], function( jQuery, access ) {

// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
	jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
		function( defaultExtra, funcName ) {

		// Margin is only for outerHeight, outerWidth
		jQuery.fn[ funcName ] = function( margin, value ) {
			var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
				extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );

			return access( this, function( elem, type, value ) {
				var doc;

				if ( jQuery.isWindow( elem ) ) {

					// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
					// isn't a whole lot we can do. See pull request at this URL for discussion:
					// https://github.com/jquery/jquery/pull/764
					return elem.document.documentElement[ "client" + name ];
				}

				// Get document width or height
				if ( elem.nodeType === 9 ) {
					doc = elem.documentElement;

					// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
					// whichever is greatest
					return Math.max(
						elem.body[ "scroll" + name ], doc[ "scroll" + name ],
						elem.body[ "offset" + name ], doc[ "offset" + name ],
						doc[ "client" + name ]
					);
				}

				return value === undefined ?

					// Get width or height on the element, requesting but not forcing parseFloat
					jQuery.css( elem, type, extra ) :

					// Set width or height on the element
					jQuery.style( elem, type, value, extra );
			}, type, chainable ? margin : undefined, chainable, null );
		};
	} );
} );

return jQuery;
} );

Version data entries

160 entries across 103 versions & 10 rubygems

Version Path
epuber-0.12.0 lib/epuber/third_party/bower/bower_components/jquery/src/dimensions.js
epuber-0.11.1 lib/epuber/third_party/bower/bower_components/jquery/src/dimensions.js
epuber-0.11.0 lib/epuber/third_party/bower/bower_components/jquery/src/dimensions.js
epuber-0.10.3 lib/epuber/third_party/bower/bower_components/jquery/src/dimensions.js
epuber-0.10.2 lib/epuber/third_party/bower/bower_components/jquery/src/dimensions.js
epuber-0.10.1 lib/epuber/third_party/bower/bower_components/jquery/src/dimensions.js
epuber-0.9.3 lib/epuber/third_party/bower/bower_components/jquery/src/dimensions.js
epuber-0.9.2 lib/epuber/third_party/bower/bower_components/jquery/src/dimensions.js
epuber-0.9.1 lib/epuber/third_party/bower/bower_components/jquery/src/dimensions.js
epuber-0.9.0 lib/epuber/third_party/bower/bower_components/jquery/src/dimensions.js
epuber-0.8.0 lib/epuber/third_party/bower/bower_components/jquery/src/dimensions.js
epuber-0.7.4 lib/epuber/third_party/bower/bower_components/jquery/src/dimensions.js
epuber-0.7.3 lib/epuber/third_party/bower/bower_components/jquery/src/dimensions.js
epuber-0.7.2 lib/epuber/third_party/bower/bower_components/jquery/src/dimensions.js
epuber-0.7.1 lib/epuber/third_party/bower/bower_components/jquery/src/dimensions.js
epuber-0.7.0 lib/epuber/third_party/bower/bower_components/jquery/src/dimensions.js
jekyll-theme-pirati-7.7.1 _sass/foundation-sites/node_modules/jquery/src/dimensions.js
jekyll-theme-pirati-7.7.1 _sass/foundation-sites/vendor/jquery/src/dimensions.js
jekyll-theme-pirati-7.7.0 _sass/foundation-sites/node_modules/jquery/src/dimensions.js
jekyll-theme-pirati-7.7.0 _sass/foundation-sites/vendor/jquery/src/dimensions.js