1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/dashboard-ui/bower_components/jquery/src/queue/delay.js

25 lines
636 B
JavaScript
Raw Normal View History

2016-01-09 13:36:35 -05:00
define( [
2015-06-26 11:53:49 -04:00
"../core",
"../queue",
"../effects" // Delay is optional because of this dependency
], function( jQuery ) {
2016-06-11 11:55:39 -04:00
"use strict";
2015-06-26 11:53:49 -04:00
// Based off of the plugin by Clint Helfers, with permission.
2016-06-11 11:55:39 -04:00
// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
2015-06-26 11:53:49 -04:00
jQuery.fn.delay = function( time, type ) {
time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
type = type || "fx";
return this.queue( type, function( next, hooks ) {
2016-01-09 13:36:35 -05:00
var timeout = window.setTimeout( next, time );
2015-06-26 11:53:49 -04:00
hooks.stop = function() {
2016-01-09 13:36:35 -05:00
window.clearTimeout( timeout );
2015-06-26 11:53:49 -04:00
};
2016-01-09 13:36:35 -05:00
} );
2015-06-26 11:53:49 -04:00
};
return jQuery.fn.delay;
2016-01-09 13:36:35 -05:00
} );