1/** 2 * @author Kim-Christian Meyer <[email protected]> 3 * @version 2.0 4 */ 5 6;(function (window, ph) { 7 8 // Returns a function, that, as long as it continues to be invoked, will not 9 // be triggered. The function will be called after it stops being called for 10 // N milliseconds. If `immediate` is passed, trigger the function on the 11 // leading edge, instead of the trailing. 12 ph.debounce = function (func, wait, immediate) { 13 var timeout; 14 return function () { 15 var context = this, args = arguments; 16 var later = function () { 17 timeout = null; 18 if (!immediate) func.apply(context, args); 19 }; 20 var callNow = immediate && !timeout; 21 window.clearTimeout(timeout); 22 timeout = window.setTimeout(later, wait); 23 if (callNow) func.apply(context, args); 24 }; 25 }; 26 27})(window, window.ph = window.ph || {});
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.