define(['angular'], function (angular) {
'use strict';
- angular.module('app.yangman').controller('yangFormMenu', menuDirective);
+ angular.module('app.yangman').directive('yangFormMenu', menuDirective);
menuDirective.$inject = [];
augmentations: '=',
allowItems: '=',
isActionMenu: '&',
- isNodeInfo: '&',
addListItemFunc: '&',
addListItem: '=',
yangForm: '=',
*/
function hideInfoBox(){
$scope.infoBox = false;
+ angular.element('#infoBox').addClass('ng-hide');
}
+
+ $scope.$on('hideInfoBox', function () {
+ hideInfoBox();
+ });
+ },
+ link: function (scope, element, attrs) {
+ scope.isActive = false;
+
+ // methods
+ scope.closeMenu = closeMenu;
+ scope.openMenu = openMenu;
+
+ /**
+ * Close Yang menu
+ */
+ function closeMenu(){
+ scope.isActive = false;
+ }
+
+ /**
+ * Open Yang menu
+ */
+ function openMenu(){
+ scope.isActive = true;
+ }
+
},
};
}