dist/crocodoc.viewer.js
function (range) {
            var currentIndex = layoutState.page - 1;
            if (range > 0) {
                range = calculateRange(range);
                // load pages in the order of priority based on the direction
                // the user is scrolling (load nearest page first, working in
                // the scroll direction, then start on the opposite side of
                // scroll direction and work outward)
                // NOTE: we're assuming that a negative scroll direction means
                // direction of previous pages, and positive is next pages...
                if (scrollDirection >= 0) {
                    queuePagesToLoadInOrder(currentIndex + 1, range.max);
                    queuePagesToLoadInOrder(currentIndex - 1, range.min);
                } else {
                    queuePagesToLoadInOrder(currentIndex - 1, range.min);
                    queuePagesToLoadInOrder(currentIndex + 1, range.max);
                }
            }
        }
function (range) {
            var currentIndex = layoutState.page - 1;
            if (range > 0) {
                range = calculateRange(range);
                // load pages in the order of priority based on the direction
                // the user is scrolling (load nearest page first, working in
                // the scroll direction, then start on the opposite side of
                // scroll direction and work outward)
                // NOTE: we're assuming that a negative scroll direction means
                // direction of previous pages, and positive is next pages...
                if (scrollDirection >= 0) {
                    queuePagesToLoadInOrder(currentIndex + 1, range.max);
                    queuePagesToLoadInOrder(currentIndex - 1, range.min);
                } else {
                    queuePagesToLoadInOrder(currentIndex - 1, range.min);
                    queuePagesToLoadInOrder(currentIndex + 1, range.max);
                }
            }
        }
function ( range ) { var currentIndex = layoutState . page - 1 ; if ( range > 0 ) { range = calculateRange ( range ) ; // load pages in the order of priority based on the direction // the user is scrolling (load nearest page first, working in // the scroll direction, then start on the opposite side of // scroll direction and work outward) // NOTE: we're assuming that a negative scroll direction means // direction of previous pages, and positive is next pages... if ( scrollDirection >= 0 ) { queuePagesToLoadInOrder ( currentIndex + 1 , range . max ) ; queuePagesToLoadInOrder ( currentIndex - 1 , range . min ) ; } else { queuePagesToLoadInOrder ( currentIndex - 1 , range . min ) ; queuePagesToLoadInOrder ( currentIndex + 1 , range . max ) ; } } }
Queue pages to load within the given range such that
proceeding pages are added before preceding pages
@param  {int} range The range to load beyond the current page
@returns {void}
Queue pages to load within the given range such that proceeding pages are added before preceding pages