mirror of
https://github.com/jquery/jquery.git
synced 2026-02-02 16:34:56 -05:00
Core: Switch from modules to just window.setTimeout etc.
Using modules for window.setTimeout etc. made those functions cached and disabled Sinon mocking, making effects tests fail. Just writing window.setTimeout directly is smaller anyway.
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
define([
|
||||
"../core",
|
||||
"../var/setTimeout",
|
||||
"../var/clearTimeout",
|
||||
"../queue",
|
||||
"../effects" // Delay is optional because of this dependency
|
||||
], function( jQuery, setTimeout, clearTimeout ) {
|
||||
], function( jQuery ) {
|
||||
|
||||
// Based off of the plugin by Clint Helfers, with permission.
|
||||
// http://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
|
||||
@@ -13,9 +11,9 @@ jQuery.fn.delay = function( time, type ) {
|
||||
type = type || "fx";
|
||||
|
||||
return this.queue( type, function( next, hooks ) {
|
||||
var timeout = setTimeout( next, time );
|
||||
var timeout = window.setTimeout( next, time );
|
||||
hooks.stop = function() {
|
||||
clearTimeout( timeout );
|
||||
window.clearTimeout( timeout );
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user