dist/crocodoc.viewer.js
function () {
            var pageComponent = this;

            loadRequested = true;

            // the page has failed to load for good... don't try anymore
            if (status === PAGE_STATUS_ERROR) {
                return false;
            }

            // don't actually load if the page is converting
            if (status === PAGE_STATUS_CONVERTING) {
                return false;
            }

            // request assets to be loaded... but only ACTUALLY load if it is
            // not loaded already
            if (status !== PAGE_STATUS_LOADED) {
                status = PAGE_STATUS_LOADING;
            }
            return $.when(pageContent.load(), pageText.load())
                .done(function handleLoadDone() {
                    if (loadRequested) {
                        if (status !== PAGE_STATUS_LOADED) {
                            $el.removeClass(CSS_CLASS_PAGE_LOADING);
                            status = PAGE_STATUS_LOADED;
                            scope.broadcast('pageload', { page: pageNum });
                        }
                    } else {
                        pageComponent.unload();
                    }
                })
                .fail(function handleLoadFail(error) {
                    status = PAGE_STATUS_ERROR;
                    $el.addClass(CSS_CLASS_PAGE_ERROR);
                    scope.broadcast('pagefail', { page: index + 1, error: error });
                });
        }
function () {
            var pageComponent = this;

            loadRequested = true;

            // the page has failed to load for good... don't try anymore
            if (status === PAGE_STATUS_ERROR) {
                return false;
            }

            // don't actually load if the page is converting
            if (status === PAGE_STATUS_CONVERTING) {
                return false;
            }

            // request assets to be loaded... but only ACTUALLY load if it is
            // not loaded already
            if (status !== PAGE_STATUS_LOADED) {
                status = PAGE_STATUS_LOADING;
            }
            return $.when(pageContent.load(), pageText.load())
                .done(function handleLoadDone() {
                    if (loadRequested) {
                        if (status !== PAGE_STATUS_LOADED) {
                            $el.removeClass(CSS_CLASS_PAGE_LOADING);
                            status = PAGE_STATUS_LOADED;
                            scope.broadcast('pageload', { page: pageNum });
                        }
                    } else {
                        pageComponent.unload();
                    }
                })
                .fail(function handleLoadFail(error) {
                    status = PAGE_STATUS_ERROR;
                    $el.addClass(CSS_CLASS_PAGE_ERROR);
                    scope.broadcast('pagefail', { page: index + 1, error: error });
                });
        }
function ( ) { var pageComponent = this ; loadRequested = true ; // the page has failed to load for good... don't try anymore if ( status === PAGE_STATUS_ERROR ) { return false ; } // don't actually load if the page is converting if ( status === PAGE_STATUS_CONVERTING ) { return false ; } // request assets to be loaded... but only ACTUALLY load if it is // not loaded already if ( status !== PAGE_STATUS_LOADED ) { status = PAGE_STATUS_LOADING ; } return $ . when ( pageContent . load ( ) , pageText . load ( ) ) . done ( function handleLoadDone ( ) { if ( loadRequested ) { if ( status !== PAGE_STATUS_LOADED ) { $el . removeClass ( CSS_CLASS_PAGE_LOADING ) ; status = PAGE_STATUS_LOADED ; scope . broadcast ( 'pageload' , { page : pageNum } ) ; } } else { pageComponent . unload ( ) ; } } ) . fail ( function handleLoadFail ( error ) { status = PAGE_STATUS_ERROR ; $el . addClass ( CSS_CLASS_PAGE_ERROR ) ; scope . broadcast ( 'pagefail' , { page : index + 1 , error : error } ) ; } ) ; }
Load and show SVG and text assets for this page
@returns {$.Promise}    jQuery Promise object or false if the page is not loading
Load and show SVG and text assets for this page