AMD-ify jQuery sourcegit s! Woo! Fixes #14113, #14163.

Conflicts:
	Gruntfile.js
	README.md
	src/ajax.js
	src/ajax/xhr.js
	src/attributes.js
	src/core.js
	src/css.js
	src/data.js
	src/effects.js
	src/event.js
	src/manipulation.js
	src/offset.js
	src/selector-native.js
	src/traversing.js
	test/unit/core.js
	test/unit/data.js
This commit is contained in:
Timmy Willison
2013-08-15 14:15:49 -04:00
parent 144837afdf
commit 217cbb7109
73 changed files with 27840 additions and 1659 deletions

View File

@@ -1,3 +1,12 @@
define([
"./core",
"./var/strundefined",
"./css",
"./selector"
], function( jQuery, strundefined ) {
var docElem = window.document.documentElement;
jQuery.fn.offset = function( options ) {
if ( arguments.length ) {
return options === undefined ?
@@ -25,7 +34,7 @@ jQuery.fn.offset = function( options ) {
// If we don't have gBCR, just use 0,0 rather than error
// BlackBerry 5, iOS 3 (original iPhone)
if ( typeof elem.getBoundingClientRect !== core_strundefined ) {
if ( typeof elem.getBoundingClientRect !== strundefined ) {
box = elem.getBoundingClientRect();
}
win = getWindow( doc );
@@ -132,6 +141,16 @@ jQuery.fn.extend({
}
});
/**
* Gets a window from an element
*/
function getWindow( elem ) {
return jQuery.isWindow( elem ) ?
elem :
elem.nodeType === 9 ?
elem.defaultView || elem.parentWindow :
false;
}
// Create scrollLeft and scrollTop methods
jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
@@ -160,10 +179,4 @@ jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( me
};
});
function getWindow( elem ) {
return jQuery.isWindow( elem ) ?
elem :
elem.nodeType === 9 ?
elem.defaultView || elem.parentWindow :
false;
}
});