main.js
function _startAssetGeneration(id) {
        if (_waitingDocuments.hasOwnProperty(id)) {
            return;
        }

        var documentPromise = _documentManager.getDocument(id);
        
        _waitingDocuments[id] = documentPromise;

        documentPromise.done(function (document) {
            delete _waitingDocuments[id];

            if (_canceledDocuments.hasOwnProperty(id)) {
                delete _canceledDocuments[id];
            } else {
                if (!_assetManagers.hasOwnProperty(id)) {
                    _assetManagers[id] = new AssetManager(_generator, _config, _logger, document, _renderManager);

                    document.on("closed", _stopAssetGeneration.bind(undefined, id));
                    document.on("end", _restartAssetGeneration.bind(undefined, id));
                    document.on("file", _handleFileChange.bind(undefined, id));
                }
                _assetManagers[id].start();
            }
        });
    }
function _startAssetGeneration(id) {
        if (_waitingDocuments.hasOwnProperty(id)) {
            return;
        }

        var documentPromise = _documentManager.getDocument(id);
        
        _waitingDocuments[id] = documentPromise;

        documentPromise.done(function (document) {
            delete _waitingDocuments[id];

            if (_canceledDocuments.hasOwnProperty(id)) {
                delete _canceledDocuments[id];
            } else {
                if (!_assetManagers.hasOwnProperty(id)) {
                    _assetManagers[id] = new AssetManager(_generator, _config, _logger, document, _renderManager);

                    document.on("closed", _stopAssetGeneration.bind(undefined, id));
                    document.on("end", _restartAssetGeneration.bind(undefined, id));
                    document.on("file", _handleFileChange.bind(undefined, id));
                }
                _assetManagers[id].start();
            }
        });
    }
function _startAssetGeneration ( id ) { if ( _waitingDocuments . hasOwnProperty ( id ) ) { return ; } var documentPromise = _documentManager . getDocument ( id ) ; _waitingDocuments [ id ] = documentPromise ; documentPromise . done ( function ( document ) { delete _waitingDocuments [ id ] ; if ( _canceledDocuments . hasOwnProperty ( id ) ) { delete _canceledDocuments [ id ] ; } else { if ( ! _assetManagers . hasOwnProperty ( id ) ) { _assetManagers [ id ] = new AssetManager ( _generator , _config , _logger , document , _renderManager ) ; document . on ( "closed" , _stopAssetGeneration . bind ( undefined , id ) ) ; document . on ( "end" , _restartAssetGeneration . bind ( undefined , id ) ) ; document . on ( "file" , _handleFileChange . bind ( undefined , id ) ) ; } _assetManagers [ id ] . start ( ) ; } } ) ; }
Enable asset generation for the given Document ID, causing all annotated
assets in the given document to be regenerated.

@private
@param {!number} id The document ID for which asset generation should be enabled.
Enable asset generation for the given Document ID causing all annotated assets in the given document to be regenerated .