{"size": 1677, "ext": "js", "max_stars_repo_path": "force-app/main/default/aura/ckz_PIM_ProductCategorySelectDialog/ckz_PIM_ProductCategorySelectDialogController.js", "max_stars_repo_name": "gcapo123/b2b-commerce-on-lightning-quickstart", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "force-app/main/default/aura/ckz_PIM_ProductCategorySelectDialog/ckz_PIM_ProductCategorySelectDialogController.js", "max_issues_repo_name": "gcapo123/b2b-commerce-on-lightning-quickstart", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "force-app/main/default/aura/ckz_PIM_ProductCategorySelectDialog/ckz_PIM_ProductCategorySelectDialogController.js", "max_forks_repo_name": "gcapo123/b2b-commerce-on-lightning-quickstart", "max_forks_repo_forks_event_min_datetime": "2021-03-29T12:52:12.000Z", "max_forks_repo_forks_event_max_datetime": "2021-03-29T12:52:12.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 31.641509434, "max_line_length": 94, "alphanum_fraction": 0.6350626118}
({
    // Dialog
    closeModel: function(component, event, helper) {
        // for Hide/Close Model,set the "isOpen" attribute to "Fasle"
        component.set("v.isOpen", false);
    },

    closeAndFinish: function(component, event, helper) {
        // Display alert message on the click on the "Like and Close" button from Model Footer
        // and set set the "isOpen" attribute to "False for close the model Box.
        //alert('OK, will close soon!');
        component.set("v.isOpen", false);

        var event = component.getEvent("productCategoryDialogEvent");

         var categoryId = component.get('v.categoryId');  // the category Id
         var categoryName = component.get('v.categoryName');

        event.setParam("categoryId", categoryId);
        event.setParam("categoryName", categoryName);

        event.fire();

    },
    // Category selection
    handleStorefrontChange : function(component, event, helper) {

        helper.displaySelectedCategoryTree(component);
    },
    selectionChange: function(component, event, helper) {

        console.log('inside selectionChange');

        event.preventDefault();

        var categoryId = event.getParam("name");  // the category Id
        var categoryName = helper.getSelectedCategoryName(component, categoryId);

        if(categoryId == null) {
            return false;
        }

        component.set('v.categoryId', categoryId);
        component.set('v.categoryName', categoryName);

    },
    waiting: function(component, event, helper) {
        helper.waiting(component);
    },
    doneWaiting: function(component, event, helper) {
        helper.doneWaiting(component);
    },
})