all files / app/core/config/ fuse-config.provider.js

87.5% Statements 14/16
50% Branches 1/2
83.33% Functions 5/6
87.5% Lines 14/16
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74                                                                                                                        
(function ()
{
    'use strict';
 
    angular
        .module('app.core')
        .provider('fuseConfig', fuseConfigProvider);
 
    /** @ngInject */
    function fuseConfigProvider()
    {
        // Default configuration
        var fuseConfiguration = {
            'disableCustomScrollbars'        : false,
            'disableMdInkRippleOnMobile'     : true,
            'disableCustomScrollbarsOnMobile': true
        };
 
        // Methods
        this.config = config;
 
        //////////
 
        /**
         * Extend default configuration with the given one
         *
         * @param configuration
         */
        function config(configuration)
        {
            fuseConfiguration = angular.extend({}, fuseConfiguration, configuration);
        }
 
        /**
         * Service
         */
        this.$get = function ()
        {
            var service = {
                getConfig: getConfig,
                setConfig: setConfig
            };
 
            return service;
 
            //////////
 
            /**
             * Returns a config value
             */
            function getConfig(configName)
            {
                Iif ( angular.isUndefined(fuseConfiguration[configName]) )
                {
                    return false;
                }
 
                return fuseConfiguration[configName];
            }
 
            /**
             * Creates or updates config object
             *
             * @param configName
             * @param configValue
             */
            function setConfig(configName, configValue)
            {
                fuseConfiguration[configName] = configValue;
            }
        };
    }
 
})();