1 define(['angular'], function (angular) {
4 angular.module('app.yangman').directive('yangFormMenu', menuDirective);
6 menuDirective.$inject = [];
8 function menuDirective() {
11 templateUrl: 'src/app/yangman/views/directives/yang-form-menu.tpl.html',
22 controller: function ($scope) {
23 var lastSection = null;
25 $scope.infoBox = false;
26 $scope.infoBoxSection = '';
27 $scope.selectedListItem = 0;
30 $scope.switchSection = switchSection;
31 $scope.hideInfoBox = hideInfoBox;
34 * Switcher for info box section
37 function switchSection(section){
38 if ( $scope.infoBox ) {
39 if ( section === lastSection ) {
40 $scope.infoBox = false;
42 $scope.infoBoxSection = section;
45 $scope.infoBox = true;
46 $scope.infoBoxSection = section;
48 lastSection = section;
54 function hideInfoBox(){
55 $scope.infoBox = false;
56 angular.element('#infoBox').addClass('ng-hide');
59 $scope.$on('hideInfoBox', function () {
63 link: function (scope, element, attrs) {
64 scope.isActive = false;
67 scope.closeMenu = closeMenu;
68 scope.openMenu = openMenu;
74 scope.isActive = false;
82 scope.isActive = true;