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;
58 link: function (scope, element, attrs) {
59 scope.isActive = false;
62 scope.closeMenu = closeMenu;
63 scope.openMenu = openMenu;
69 scope.isActive = false;
76 scope.isActive = true;