{"size": 1282, "ext": "js", "max_stars_repo_path": "BackofficeBundle/Resources/public/ecmascript/OpenOrchestra/Application/Router/Block/AbstractBlockRouter.js", "max_stars_repo_name": "open-orchestra/open-orchestra-cms-bundle", "max_stars_repo_stars_event_min_datetime": "2015-04-02T08:04:46.000Z", "max_stars_repo_stars_event_max_datetime": "2018-08-22T08:14:20.000Z", "max_issues_repo_path": "BackofficeBundle/Resources/public/ecmascript/OpenOrchestra/Application/Router/Block/AbstractBlockRouter.js", "max_issues_repo_name": "open-orchestra/open-orchestra-cms-bundle", "max_issues_repo_issues_event_min_datetime": "2015-04-02T13:23:40.000Z", "max_issues_repo_issues_event_max_datetime": "2018-05-28T07:42:19.000Z", "max_forks_repo_path": "BackofficeBundle/Resources/public/ecmascript/OpenOrchestra/Application/Router/Block/AbstractBlockRouter.js", "max_forks_repo_name": "open-orchestra/open-orchestra-cms-bundle", "max_forks_repo_forks_event_min_datetime": "2015-04-11T21:49:48.000Z", "max_forks_repo_forks_event_max_datetime": "2017-10-31T13:21:00.000Z"}
{"max_stars_count": 8, "max_issues_count": 1441, "max_forks_count": 10, "avg_line_length": 38.8484848485, "max_line_length": 104, "alphanum_fraction": 0.616224649}
import OrchestraRouter                 from 'OpenOrchestra/Application/Router/OrchestraRouter'
import Application                     from 'OpenOrchestra/Application/Application'
import BlockComponents                 from 'OpenOrchestra/Application/Collection/Block/BlockComponents'

/**
 * @class AbstractBlockRouter
 */
class AbstractBlockRouter extends OrchestraRouter
{
    /**
     * New block list component
     *
     * @param {String}                            language
     * @param {Object}                            viewParameters
     * @param {AbstractNewBlockComponentListView} newBlockComponentListView
     */
    _newBlockListComponent(newBlockComponentListView, language, viewParameters = {}) {
        this._displayLoader(Application.getRegion('content'));
        new BlockComponents().fetch({
            success: (blockComponents) => {
                viewParameters = $.extend({}, viewParameters, {
                    blockComponents : blockComponents,
                    language: language
                });
                let newBlockListView = new newBlockComponentListView(viewParameters);
                Application.getRegion('content').html(newBlockListView.render().$el);
            }
        })
    }
}

export default AbstractBlockRouter;
