Sha256: 932611581adc8afb69e7029cce07d63dc821cfca773951569cc317b04493749e

Contents?: true

Size: 1.73 KB

Versions: 417

Compression:

Stored size: 1.73 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

417 entries across 417 versions & 30 rubygems

Version Path
abstracted-0.4.17 vendor/assets/components/jquery/src/dimensions.js
abstracted-0.4.16 vendor/assets/components/jquery/src/dimensions.js
abstracted-0.4.15 vendor/assets/components/jquery/src/dimensions.js
abstracted-0.4.14 vendor/assets/components/jquery/src/dimensions.js
middleman-core-4.2.1 fixtures/import-app/bower_components/jquery/src/dimensions.js
trusty-festivity-extension-2.6.3 vendor/assets/components/jquery/src/dimensions.js
trusty-festivity-extension-2.6.2 vendor/assets/components/jquery/src/dimensions.js
unpoly-rails-0.32.0 spec_app/vendor/assets/bower_components/jquery/src/dimensions.js
middleman-core-4.2.0 fixtures/import-app/bower_components/jquery/src/dimensions.js
trusty-festivity-extension-2.6.1 vendor/assets/components/jquery/src/dimensions.js
middleman-core-4.1.14 fixtures/import-app/bower_components/jquery/src/dimensions.js
middleman-core-4.1.13 fixtures/import-app/bower_components/jquery/src/dimensions.js
trusty-festivity-extension-2.6 vendor/assets/components/jquery/src/dimensions.js
active_record_survey_api-0.0.19 spec/test_app/vendor/assets/bower_components/jquery/src/dimensions.js
active_record_survey_api-0.0.18 spec/test_app/vendor/assets/bower_components/jquery/src/dimensions.js
middleman-core-4.1.12 fixtures/import-app/bower_components/jquery/src/dimensions.js
active_record_survey_api-0.0.17 spec/test_app/vendor/assets/bower_components/jquery/src/dimensions.js
active_record_survey_api-0.0.14 spec/test_app/vendor/assets/bower_components/jquery/src/dimensions.js
abstracted-0.4.13 vendor/assets/components/jquery/src/dimensions.js
unpoly-rails-0.31.2 spec_app/vendor/assets/bower_components/jquery/src/dimensions.js