Explorar el Código

impl depth option

Yuki Takei hace 9 años
padre
commit
87579410ff

+ 2 - 2
packages/growi-plugin-lsx/src/resource/js/components/PageNode.js

@@ -21,10 +21,10 @@ export class PageNode {
    */
    */
   getDecendantsGenerationsNum() {
   getDecendantsGenerationsNum() {
     if (this.children.length == 0) {
     if (this.children.length == 0) {
-      return 0;
+      return -1;
     }
     }
 
 
-    return -1 + Math.max.apply(null, this.children.map((child) => {
+    return -1 + Math.min.apply(null, this.children.map((child) => {
       return child.getDecendantsGenerationsNum();
       return child.getDecendantsGenerationsNum();
     }))
     }))
   }
   }