Specify support as a dependency wherever it is used. Optimize module order to save 15 bytes.

Conflicts:
	src/css.js
	src/manipulation.js
	src/offset.js
	src/support.js
This commit is contained in:
Timmy Willison 2013-08-15 20:38:48 -04:00
parent f5b1a8eab7
commit 7315861813
10 changed files with 21 additions and 12 deletions

View File

@ -86,7 +86,7 @@ Some example modules that can be excluded are:
- **offset**: The `.offset()`, `.position()`, `.offsetParent()`, `.scrollLeft()`, and `.scrollTop()` methods. - **offset**: The `.offset()`, `.position()`, `.offsetParent()`, `.scrollLeft()`, and `.scrollTop()` methods.
- **wrap**: The `.wrap()`, `.wrapAll()`, `.wrapInner()`, and `.unwrap()` methods. - **wrap**: The `.wrap()`, `.wrapAll()`, `.wrapInner()`, and `.unwrap()` methods.
- **exports/amd**: Exclude the AMD definition. - **exports/amd**: Exclude the AMD definition.
- **core/ready**: Exclude the ready module if you place your scripts at the end of the body. Any ready callbacks will simply be called immediately. - **core/ready**: Exclude the ready module if you place your scripts at the end of the body. Any ready callbacks bound with `jQuery()` will simply be called immediately. However, `jQuery(document).ready()` will not be a function and `.on("ready", ...)` or similar will not be triggered.
- **deferred**: Exclude jQuery.Deferred. This also removes jQuery.Callbacks. *Note* that modules that depend on jQuery.Deferred(AJAX, effects, core/ready) will not be removed and will still expect jQuery.Deferred to be there. Include your own jQuery.Deferred implementation or exclude those modules as well (`grunt custom:-deferred,-ajax,-effects,-core/ready`). - **deferred**: Exclude jQuery.Deferred. This also removes jQuery.Callbacks. *Note* that modules that depend on jQuery.Deferred(AJAX, effects, core/ready) will not be removed and will still expect jQuery.Deferred to be there. Include your own jQuery.Deferred implementation or exclude those modules as well (`grunt custom:-deferred,-ajax,-effects,-core/ready`).
- **support**: Excluding the support module is not recommended, but possible. It's your responsibility to either remove modules that use jQuery.support (many of them) or replace the values wherever jQuery.support is used. This is mainly only useful when building a barebones version of jQuery. - **support**: Excluding the support module is not recommended, but possible. It's your responsibility to either remove modules that use jQuery.support (many of them) or replace the values wherever jQuery.support is used. This is mainly only useful when building a barebones version of jQuery.

View File

@ -1,6 +1,7 @@
define([ define([
"../core", "../core",
"../ajax" "../ajax",
"../support"
], function( jQuery ) { ], function( jQuery ) {
var xhrCallbacks, xhrSupported, var xhrCallbacks, xhrSupported,

View File

@ -2,7 +2,8 @@ define([
"../core", "../core",
"../var/rnotwhite", "../var/rnotwhite",
"../var/strundefined", "../var/strundefined",
"../selector" "../selector",
"../support"
], function( jQuery, rnotwhite, strundefined ) { ], function( jQuery, rnotwhite, strundefined ) {
var nodeHook, boolHook, var nodeHook, boolHook,

View File

@ -1,5 +1,6 @@
define([ define([
"../core" "../core",
"../support"
], function( jQuery ) { ], function( jQuery ) {
var rfocusable = /^(?:input|select|textarea|button|object)$/i, var rfocusable = /^(?:input|select|textarea|button|object)$/i,

View File

@ -1,5 +1,6 @@
define([ define([
"../core" "../core",
"../support"
], function( jQuery ) { ], function( jQuery ) {
var rreturn = /\r/g; var rreturn = /\r/g;

View File

@ -5,7 +5,8 @@ define([
"./css/var/isHidden", "./css/var/isHidden",
"./css/defaultDisplay", "./css/defaultDisplay",
"./core/swap", "./core/swap",
"./selector" // contains "./selector", // contains
"./support"
], function( jQuery, pnum, cssExpand, isHidden, defaultDisplay ) { ], function( jQuery, pnum, cssExpand, isHidden, defaultDisplay ) {
var getStyles, curCSS, var getStyles, curCSS,

4
src/jquery.js vendored
View File

@ -1,10 +1,11 @@
define([ define([
"./core", "./core",
"./selector", "./selector",
"./traversing",
"./callbacks", "./callbacks",
"./deferred", "./deferred",
"./core/ready", "./core/ready",
"./traversing", "./support",
"./data", "./data",
"./queue", "./queue",
"./queue/delay", "./queue/delay",
@ -26,7 +27,6 @@ define([
"./effects/animated-selector", "./effects/animated-selector",
"./offset", "./offset",
"./dimensions", "./dimensions",
"./support",
"./deprecated" "./deprecated"
], function( jQuery ) { ], function( jQuery ) {

View File

@ -7,7 +7,8 @@ define([
"./data/accepts", "./data/accepts",
"./selector", "./selector",
"./traversing", "./traversing",
"./event" "./event",
"./support"
], function( jQuery, concat, push, deletedIds, rcheckableType ){ ], function( jQuery, concat, push, deletedIds, rcheckableType ){
function createSafeFragment( document ) { function createSafeFragment( document ) {

View File

@ -2,7 +2,7 @@ define([
"./core", "./core",
"./var/strundefined", "./var/strundefined",
"./css", "./css",
"./selector" "./selector" // contains
], function( jQuery, strundefined ) { ], function( jQuery, strundefined ) {
var docElem = window.document.documentElement; var docElem = window.document.documentElement;
@ -133,7 +133,8 @@ jQuery.fn.extend({
offsetParent: function() { offsetParent: function() {
return this.map(function() { return this.map(function() {
var offsetParent = this.offsetParent || docElem; var offsetParent = this.offsetParent || docElem;
while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) {
offsetParent = offsetParent.offsetParent; offsetParent = offsetParent.offsetParent;
} }
return offsetParent || docElem; return offsetParent || docElem;

View File

@ -1,7 +1,9 @@
define([ define([
"./core", "./core",
"./var/strundefined", "./var/strundefined",
"./core/swap" "./core/swap",
// This is listed as a dependency for build order, but it's still optional in builds
"./core/ready"
], function( jQuery, strundefined ) { ], function( jQuery, strundefined ) {
jQuery.support = (function( support ) { jQuery.support = (function( support ) {