assets/dashboard/vendor/html5sortable.js
function _throttle (fn, threshold) {
        var _this = this;
        if (threshold === void 0) { threshold = 250; }
        // check function
        if (typeof fn !== 'function') {
            throw new Error('You must provide a function as the first argument for throttle.');
        }
        // check threshold
        if (typeof threshold !== 'number') {
            throw new Error('You must provide a number as the second argument for throttle.');
        }
        var lastEventTimestamp = null;
        return function () {
            var args = [];
            for (var _i = 0; _i < arguments.length; _i++) {
                args[_i - 0] = arguments[_i];
            }
            var now = Date.now();
            if (lastEventTimestamp === null || now - lastEventTimestamp >= threshold) {
                lastEventTimestamp = now;
                fn.apply(_this, args);
            }
        };
    }
function _throttle (fn, threshold) {
        var _this = this;
        if (threshold === void 0) { threshold = 250; }
        // check function
        if (typeof fn !== 'function') {
            throw new Error('You must provide a function as the first argument for throttle.');
        }
        // check threshold
        if (typeof threshold !== 'number') {
            throw new Error('You must provide a number as the second argument for throttle.');
        }
        var lastEventTimestamp = null;
        return function () {
            var args = [];
            for (var _i = 0; _i < arguments.length; _i++) {
                args[_i - 0] = arguments[_i];
            }
            var now = Date.now();
            if (lastEventTimestamp === null || now - lastEventTimestamp >= threshold) {
                lastEventTimestamp = now;
                fn.apply(_this, args);
            }
        };
    }
function _throttle ( fn , threshold ) { var _this = this ; if ( threshold === void 0 ) { threshold = 250 ; } // check function if ( typeof fn !== 'function' ) { throw new Error ( 'You must provide a function as the first argument for throttle.' ) ; } // check threshold if ( typeof threshold !== 'number' ) { throw new Error ( 'You must provide a number as the second argument for throttle.' ) ; } var lastEventTimestamp = null ; return function ( ) { var args = [ ] ; for ( var _i = 0 ; _i < arguments . length ; _i ++ ) { args [ _i - 0 ] = arguments [ _i ] ; } var now = Date . now ( ) ; if ( lastEventTimestamp === null || now - lastEventTimestamp >= threshold ) { lastEventTimestamp = now ; fn . apply ( _this , args ) ; } } ; }
make sure a function is only called once within the given amount of time
@param {Function} fn the function to throttle
@param {number} threshold time limit for throttling
 must use function to keep this context
make sure a function is only called once within the given amount of time