Merge "Yangman - info box from yang menu"
authorMaxime Millette-Coulombe <mmcoulombe@inocybe.com>
Thu, 11 Aug 2016 22:33:03 +0000 (22:33 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 11 Aug 2016 22:33:03 +0000 (22:33 +0000)
modules/yangman-resources/src/main/resources/yangman/controllers/form/list.controller.js
modules/yangman-resources/src/main/resources/yangman/directives/yang-form-menu.directive.js

index ef7e6cee631728ba3f647d3eca0415502ffb2aaf..a5bf8d37794b5efc84d7eb01aa8479a985302116 100644 (file)
@@ -75,6 +75,9 @@ define([], function () {
             // $scope.preview();
             yangList.currentDisplayIndex =
                 Math.max(Math.min(yangList.currentDisplayIndex, $scope.node.listData.length - 2), 1);
+            if ($scope.node.listData.length === 0) {
+                $scope.$broadcast('hideInfoBox');
+            }
         }
 
         // TODO :: do method description
index 7b09b06c52eca96fe9bcdfe572b9a70a66d29343..fc8ebb582fd1b5e5b6bd92168c17efa9c41e7480 100644 (file)
@@ -54,6 +54,10 @@ define(['angular'], function (angular) {
                 function hideInfoBox(){
                     $scope.infoBox = false;
                 }
+
+                $scope.$on('hideInfoBox', function () {
+                    hideInfoBox();
+                });
             },
             link: function (scope, element, attrs) {
                 scope.isActive = false;