dist/crocodoc.viewer.js
function (updateClasses) {
            var i, len, $page,
                state = this.state,
                visibleRange = this.calculateVisibleRange(),
                fullyVisibleRange = this.calculateFullyVisibleRange();
            state.visiblePages.length = 0;
            state.fullyVisiblePages.length = 0;
            for (i = 0, len = this.$pages.length; i < len; ++i) {
                $page = this.$pages.eq(i);
                if (i < visibleRange.min || i > visibleRange.max) {
                    if (updateClasses && $page.hasClass(CSS_CLASS_PAGE_VISIBLE)) {
                        $page.removeClass(CSS_CLASS_PAGE_VISIBLE);
                    }
                } else {
                    if (updateClasses && !$page.hasClass(CSS_CLASS_PAGE_VISIBLE)) {
                        $page.addClass(CSS_CLASS_PAGE_VISIBLE);
                    }
                    state.visiblePages.push(i + 1);
                }
                if (i >= fullyVisibleRange.min && i <= fullyVisibleRange.max) {
                    state.fullyVisiblePages.push(i + 1);
                }
            }
        }
function (updateClasses) {
            var i, len, $page,
                state = this.state,
                visibleRange = this.calculateVisibleRange(),
                fullyVisibleRange = this.calculateFullyVisibleRange();
            state.visiblePages.length = 0;
            state.fullyVisiblePages.length = 0;
            for (i = 0, len = this.$pages.length; i < len; ++i) {
                $page = this.$pages.eq(i);
                if (i < visibleRange.min || i > visibleRange.max) {
                    if (updateClasses && $page.hasClass(CSS_CLASS_PAGE_VISIBLE)) {
                        $page.removeClass(CSS_CLASS_PAGE_VISIBLE);
                    }
                } else {
                    if (updateClasses && !$page.hasClass(CSS_CLASS_PAGE_VISIBLE)) {
                        $page.addClass(CSS_CLASS_PAGE_VISIBLE);
                    }
                    state.visiblePages.push(i + 1);
                }
                if (i >= fullyVisibleRange.min && i <= fullyVisibleRange.max) {
                    state.fullyVisiblePages.push(i + 1);
                }
            }
        }
function ( updateClasses ) { var i , len , $page , state = this . state , visibleRange = this . calculateVisibleRange ( ) , fullyVisibleRange = this . calculateFullyVisibleRange ( ) ; state . visiblePages . length = 0 ; state . fullyVisiblePages . length = 0 ; for ( i = 0 , len = this . $pages . length ; i < len ; ++ i ) { $page = this . $pages . eq ( i ) ; if ( i < visibleRange . min || i > visibleRange . max ) { if ( updateClasses && $page . hasClass ( CSS_CLASS_PAGE_VISIBLE ) ) { $page . removeClass ( CSS_CLASS_PAGE_VISIBLE ) ; } } else { if ( updateClasses && ! $page . hasClass ( CSS_CLASS_PAGE_VISIBLE ) ) { $page . addClass ( CSS_CLASS_PAGE_VISIBLE ) ; } state . visiblePages . push ( i + 1 ) ; } if ( i >= fullyVisibleRange . min && i <= fullyVisibleRange . max ) { state . fullyVisiblePages . push ( i + 1 ) ; } } }
Calculate and update which pages are visible,
possibly updating CSS classes on the pages
@param {boolean} updateClasses Wheter to update page CSS classes as well
@returns {void}
Calculate and update which pages are visible possibly updating CSS classes on the pages