all files / app/main/components/material-docs/layout/ layout.controller.js

26.67% Statements 4/15
0% Branches 0/4
20% Functions 1/5
26.67% Lines 4/15
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                                                                                        
(function ()
{
    'use strict';
 
    angular
        .module('app.components.material-docs')
        .controller('LayoutCtrl', LayoutCtrl)
        .controller('LayoutTipsCtrl', LayoutTipsCtrl);
 
    /** @ngInject */
    function LayoutCtrl($scope, $attrs, $location, $rootScope)
    {
        $rootScope.currentComponent = $rootScope.currentDoc = null;
 
        $scope.exampleNotEditable = true;
        $scope.layoutDemo = {
            mainAxis : 'center',
            crossAxis: 'center',
            direction: 'row'
        };
        $scope.layoutAlign = function ()
        {
            return $scope.layoutDemo.mainAxis +
                   ($scope.layoutDemo.crossAxis ? ' ' + $scope.layoutDemo.crossAxis : '');
        };
    }
 
    /** @ngInject */
    function LayoutTipsCtrl()
    {
        var self = this;
 
        /*
         * Flex Sizing - Odd
         */
        self.toggleButtonText = 'Hide';
 
        self.toggleContentSize = function ()
        {
            var contentEl = angular.element(document.getElementById('toHide'));
 
            contentEl.toggleClass('ng-hide');
 
            self.toggleButtonText = contentEl.hasClass('ng-hide') ? 'Show' : 'Hide';
        };
    }
 
})();