1/* 2 * debouncedresize: special jQuery event that happens once after a window resize 3 * 4 * latest version and complete README available on Github: 5 * https://github.com/louisremi/jquery-smartresize 6 * 7 * Copyright 2012 @louis_remi 8 * Licensed under the MIT license. 9 * 10 * This saved you an hour of work? 11 * Send me music http://www.amazon.co.uk/wishlist/HNTU0468LQON 12 */ 13(function($) { 14 15var $event = $.event, 16 $special, 17 resizeTimeout; 18 19$special = $event.special.debouncedresize = { 20 setup: function() { 21 $( this ).on( "resize", $special.handler ); 22 }, 23 teardown: function() { 24 $( this ).off( "resize", $special.handler ); 25 }, 26 handler: function( event, execAsap ) { 27 // Save the context 28 var context = this, 29 args = arguments, 30 dispatch = function() { 31 // set correct event type 32 event.type = "debouncedresize"; 33 $event.dispatch.apply( context, args ); 34 }; 35 36 if ( resizeTimeout ) { 37 clearTimeout( resizeTimeout ); 38 } 39 40 execAsap ? 41 dispatch() : 42 resizeTimeout = setTimeout( dispatch, $special.threshold ); 43 }, 44 threshold: 150 45}; 46 47})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.