Yangman - info box from yang menu 30/43630/2
authormichal.kovacik <mikovaci@cisco.com>
Wed, 10 Aug 2016 13:54:56 +0000 (15:54 +0200)
committerMichal Kovacik <mikovaci@cisco.com>
Thu, 11 Aug 2016 09:44:19 +0000 (09:44 +0000)
-hide info box when all items has been deleted

Change-Id: If5b06a6f87c91f3540d995fab3eb675c146636c8
Signed-off-by: michal.kovacik <mikovaci@cisco.com>
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;