Sha256: 828f50cd4dba47444893b1dd42b419b4787dd284fff4e5ad92fe832b9aa42a89

Contents?: true

Size: 1.84 KB

Versions: 6

Compression:

Stored size: 1.84 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
					// unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
					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

6 entries across 6 versions & 3 rubygems

Version Path
rails_modular_admin-1.0.0 app/assets/node_modules/jqvmap/node_modules/jquery/src/dimensions.js
rails_modular_admin-0.4.0 app/assets/node_modules/jqvmap/node_modules/jquery/src/dimensions.js
simpletool-0.0.3 lib/support/phpmyadmin/phpmyadmin/js/jquery/src/jquery/dimensions.js
simpletool-0.0.2 lib/support/phpmyadmin/phpmyadmin/js/jquery/src/jquery/dimensions.js
kanpachi-0.0.7 lib/kanpachi/doc/template/components/jquery/src/dimensions.js
kanpachi-0.0.6 lib/kanpachi/doc/template/components/jquery/src/dimensions.js