main.js
function _handleOpenDocumentsChanged(all, opened) {
        var open = opened || all;

        open.forEach(function (id) {
            _documentManager.getDocument(id).done(function (document) {
                document.on("generatorSettings", _handleDocGeneratorSettingsChange.bind(undefined, id));
            }, function (error) {
                _logger.warning("Error getting document during a document changed event, " +
                    "document was likely closed.", error);
            });
        });
    }
function _handleOpenDocumentsChanged(all, opened) {
        var open = opened || all;

        open.forEach(function (id) {
            _documentManager.getDocument(id).done(function (document) {
                document.on("generatorSettings", _handleDocGeneratorSettingsChange.bind(undefined, id));
            }, function (error) {
                _logger.warning("Error getting document during a document changed event, " +
                    "document was likely closed.", error);
            });
        });
    }
function _handleOpenDocumentsChanged ( all , opened ) { var open = opened || all ; open . forEach ( function ( id ) { _documentManager . getDocument ( id ) . done ( function ( document ) { document . on ( "generatorSettings" , _handleDocGeneratorSettingsChange . bind ( undefined , id ) ) ; } , function ( error ) { _logger . warning ( "Error getting document during a document changed event, " + "document was likely closed." , error ) ; } ) ; } ) ; }
Handler for a the "openDocumentsChanged" event emitted by the DocumentManager.
Registers a generatorSettings change to update the StateManager appropiately

@private
@param {Array.<number>} all The complete set of open document IDs
@param {Array.<number>=} opened The set of newly opened document IDs
Handler for a the openDocumentsChanged event emitted by the DocumentManager . Registers a generatorSettings change to update the StateManager appropiately