scratch – Blame information for rev 125

Subversion Repositories:
Rev:
Rev Author Line No. Line
125 office 1 define([
58 office 2 "./core",
3 "./core/access",
4 "./css"
5 ], function( jQuery, access ) {
6  
7 // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
8 jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
125 office 9 jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
58 office 10 // Margin is only for outerHeight, outerWidth
11 jQuery.fn[ funcName ] = function( margin, value ) {
12 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
13 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
14  
15 return access( this, function( elem, type, value ) {
16 var doc;
17  
18 if ( jQuery.isWindow( elem ) ) {
125 office 19 // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
20 // isn't a whole lot we can do. See pull request at this URL for discussion:
21 // https://github.com/jquery/jquery/pull/764
22 return elem.document.documentElement[ "client" + name ];
58 office 23 }
24  
25 // Get document width or height
26 if ( elem.nodeType === 9 ) {
27 doc = elem.documentElement;
28  
29 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
30 // whichever is greatest
31 return Math.max(
32 elem.body[ "scroll" + name ], doc[ "scroll" + name ],
33 elem.body[ "offset" + name ], doc[ "offset" + name ],
34 doc[ "client" + name ]
35 );
36 }
37  
38 return value === undefined ?
39 // Get width or height on the element, requesting but not forcing parseFloat
40 jQuery.css( elem, type, extra ) :
41  
42 // Set width or height on the element
43 jQuery.style( elem, type, value, extra );
125 office 44 }, type, chainable ? margin : undefined, chainable, null );
58 office 45 };
125 office 46 });
47 });
58 office 48  
49 return jQuery;
125 office 50 });