dist/crocodoc.viewer.js
function completeInit() {
        setCSSFlags();

        // initialize scroller and resizer components
        scroller = scope.createComponent('scroller');
        scroller.init(config.$viewport);
        resizer = scope.createComponent('resizer');
        resizer.init(config.$viewport);

        var controller;
        switch (config.metadata.type) {
            case 'text':
                // load text-based viewer
                controller = scope.createComponent('controller-text');
                // force the text layout only
                // @TODO: allow overriding the layout eventually
                config.layout = LAYOUT_TEXT;
                break;

            case 'paged':
                /* falls through */
            default:
                controller = scope.createComponent('controller-paged');
                break;
        }
        controller.init();

        // disable text selection if necessary
        if (config.metadata.type === 'text') {
            if (!config.enableTextSelection) {
                api.disableTextSelection();
            }
        } else if (browser.ielt9) {
            api.disableTextSelection();
        }

        // disable links if necessary
        // @NOTE: links are disabled in IE < 9
        if (!config.enableLinks || browser.ielt9) {
            api.disableLinks();
        }

        // set the initial layout
        api.setLayout(config.layout);

        // broadcast ready message
        scope.broadcast('ready', {
            page: config.page || 1,
            numPages: config.numPages
        });

        scope.ready();
    }
function completeInit() {
        setCSSFlags();

        // initialize scroller and resizer components
        scroller = scope.createComponent('scroller');
        scroller.init(config.$viewport);
        resizer = scope.createComponent('resizer');
        resizer.init(config.$viewport);

        var controller;
        switch (config.metadata.type) {
            case 'text':
                // load text-based viewer
                controller = scope.createComponent('controller-text');
                // force the text layout only
                // @TODO: allow overriding the layout eventually
                config.layout = LAYOUT_TEXT;
                break;

            case 'paged':
                /* falls through */
            default:
                controller = scope.createComponent('controller-paged');
                break;
        }
        controller.init();

        // disable text selection if necessary
        if (config.metadata.type === 'text') {
            if (!config.enableTextSelection) {
                api.disableTextSelection();
            }
        } else if (browser.ielt9) {
            api.disableTextSelection();
        }

        // disable links if necessary
        // @NOTE: links are disabled in IE < 9
        if (!config.enableLinks || browser.ielt9) {
            api.disableLinks();
        }

        // set the initial layout
        api.setLayout(config.layout);

        // broadcast ready message
        scope.broadcast('ready', {
            page: config.page || 1,
            numPages: config.numPages
        });

        scope.ready();
    }
function completeInit ( ) { setCSSFlags ( ) ; // initialize scroller and resizer components scroller = scope . createComponent ( 'scroller' ) ; scroller . init ( config . $viewport ) ; resizer = scope . createComponent ( 'resizer' ) ; resizer . init ( config . $viewport ) ; var controller ; switch ( config . metadata . type ) { case 'text' : // load text-based viewer controller = scope . createComponent ( 'controller-text' ) ; // force the text layout only // @TODO: allow overriding the layout eventually config . layout = LAYOUT_TEXT ; break ; case 'paged' : /* falls through */ default : controller = scope . createComponent ( 'controller-paged' ) ; break ; } controller . init ( ) ; // disable text selection if necessary if ( config . metadata . type === 'text' ) { if ( ! config . enableTextSelection ) { api . disableTextSelection ( ) ; } } else if ( browser . ielt9 ) { api . disableTextSelection ( ) ; } // disable links if necessary // @NOTE: links are disabled in IE < 9 if ( ! config . enableLinks || browser . ielt9 ) { api . disableLinks ( ) ; } // set the initial layout api . setLayout ( config . layout ) ; // broadcast ready message scope . broadcast ( 'ready' , { page : config . page || 1 , numPages : config . numPages } ) ; scope . ready ( ) ; }
Complete intialization after document metadata has been loaded;
ie., bind events, init lazyloader and layout, broadcast ready message
@returns {void}
@private
Complete intialization after document metadata has been loaded ; ie . bind events init lazyloader and layout broadcast ready message