<commit_before>/*
 * Copyright (c) 2015 Juniper Networks, Inc. All rights reserved.
 */

var controllerInfraDashboardLoader = new ControllerInfraDashboardLoader();


function ControllerInfraDashboardLoader() {
    this.load = function (paramObject) {
        var self = this, currMenuObj = globalObj.currMenuObj,
            hashParams = paramObject['hashParams'],
            rootDir = currMenuObj['resources']['resource'][1]['rootDir'],
            renderFn = paramObject['function'];

        if (self.monInfraDashboardView == null) {
            require(['mon-infra-dashboard-view'],function() {
                require(['mon-infra-controller-dashboard'], function (ControllerDashboardView) {
                    self.monInfraDashboardView = new ControllerDashboardView({
                        el: $(contentContainer)
                    });
                    self.monInfraDashboardView.render();
                });
            });
        } else {
            self.renderView(renderFn, hashParams);
        }
    };<commit_msg>Closes-Bug: #1551413 Once monInfraDashboard file (core repo) gets loaded, controllerInfraDashboard file(controller repo) file adds the infoboxes related to controller repo. Have seen cases, that controllerInfraDashboard adds the infoboxes more than once we click on "Dashboard" in quick succession Added a check if controllerInfraDashboard infoboxes are already loaded,don't add them again<commit_after>/*
 * Copyright (c) 2015 Juniper Networks, Inc. All rights reserved.
 */

var controllerInfraDashboardLoader = new ControllerInfraDashboardLoader();


function ControllerInfraDashboardLoader() {
    this.load = function (paramObject) {
        var self = this, currMenuObj = globalObj.currMenuObj,
            hashParams = paramObject['hashParams'],
            rootDir = currMenuObj['resources']['resource'][1]['rootDir'],
            renderFn = paramObject['function'];

        if(monInfraDashboardLoader.loadedControllerInfoboxes != true) {
            monInfraDashboardLoader.loadedControllerInfoboxes = true;
            require(['mon-infra-dashboard-view'],function() {
                require(['mon-infra-controller-dashboard'], function (ControllerDashboardView) {
                    self.monInfraDashboardView = new ControllerDashboardView({
                        el: $(contentContainer)
                    });
                    self.monInfraDashboardView.render();
                });
            });
        }
    };
{'fraction_non_alphanumeric': 0.10105092966855295, 'fraction_numerical': 0.0068714632174616, 'mean_word_length': 2.6450662739322532, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '833148', 'n_tokens_mistral': 635, 'n_tokens_neox': 623, 'n_words': 139}