all files / app/core/ core.run.js

76.92% Statements 10/13
62.5% Branches 5/8
100% Functions 2/2
76.92% Lines 10/13
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                                                                        
(function ()
{
    'use strict';
 
    angular
        .module('app.core')
        .run(runBlock);
 
    /** @ngInject */
    function runBlock(msUtils, fuseGenerator, fuseConfig)
    {
        /**
         * Generate extra classes based on registered themes so we
         * can use same colors with non-angular-material elements
         */
        fuseGenerator.generate();
 
        /**
         * Disable md-ink-ripple effects on mobile
         * if 'disableMdInkRippleOnMobile' config enabled
         */
        Iif ( fuseConfig.getConfig('disableMdInkRippleOnMobile') && msUtils.isMobile() )
        {
            var bodyEl = angular.element('body');
            bodyEl.attr('md-no-ink', true);
        }
 
        /**
         * Put isMobile() to the html as a class
         */
        Iif ( msUtils.isMobile() )
        {
            angular.element('html').addClass('is-mobile');
        }
 
        /**
         * Put browser information to the html as a class
         */
        var browserInfo = msUtils.detectBrowser();
        Eif ( browserInfo )
        {
            var htmlClass = browserInfo.browser + ' ' + browserInfo.version + ' ' + browserInfo.os;
            angular.element('html').addClass(htmlClass);
        }
    }
})();