소스 검색

impl depth option

Yuki Takei 9 년 전
부모
커밋
87579410ff
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      packages/growi-plugin-lsx/src/resource/js/components/PageNode.js

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

@@ -21,10 +21,10 @@ export class PageNode {
    */
   getDecendantsGenerationsNum() {
     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();
     }))
   }