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:
Michał Gołębiowski
2015-06-17 12:55:59 +02:00
parent 219c749493
commit 842958e7ae
9 changed files with 14 additions and 37 deletions

View File

@@ -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 );
};
});
};