Browse Source

[security] Item click does not expand the children

Enrico Berti 11 năm trước cách đây
mục cha
commit
37cbc21d9f
2 tập tin đã thay đổi với 11 bổ sung2 xóa
  1. 5 1
      apps/security/static/js/hdfs.ko.js
  2. 6 1
      apps/security/static/js/hive.ko.js

+ 5 - 1
apps/security/static/js/hdfs.ko.js

@@ -310,10 +310,14 @@ var Assist = function (vm, assist) {
       if (typeof toggle == "boolean" && toggle){
         obj.isExpanded(!obj.isExpanded());
       } else {
-        obj.isExpanded(true);
+        obj.isExpanded(false);
       }
       self.updatePathProperty(self.growingTree(), obj.path(), "isExpanded", obj.isExpanded());
     }
+    else {
+      obj.isExpanded(false);
+      self.updatePathProperty(self.growingTree(), obj.path(), "isExpanded", obj.isExpanded());
+    }
     self.path(obj.path());
   }
 

+ 6 - 1
apps/security/static/js/hive.ko.js

@@ -425,6 +425,7 @@ var Assist = function (vm) {
                   if (ipath.split(".").length == 2 && ipath.split(".")[0] == path){
                     self.fetchHivePath(ipath, function() {
                       self.updateTreeProperty(self.growingTree(), "isExpanded", true);
+                      self.loadData(self.growingTree());
                     });
                   }
                 });
@@ -443,10 +444,14 @@ var Assist = function (vm) {
         obj.isExpanded(!obj.isExpanded());
       }
       else {
-        obj.isExpanded(true);
+        obj.isExpanded(false);
       }
       self.updatePathProperty(self.growingTree(), obj.path(), "isExpanded", obj.isExpanded());
     }
+    else {
+      obj.isExpanded(false);
+      self.updatePathProperty(self.growingTree(), obj.path(), "isExpanded", obj.isExpanded());
+    }
     self.path(obj.path());
     $(document).trigger("changed.path");
     self.fetchHivePath();