diff --git a/src/main/resources/static/js/board/contentList.js b/src/main/resources/static/js/board/contentList.js index f38002d..38bb073 100644 --- a/src/main/resources/static/js/board/contentList.js +++ b/src/main/resources/static/js/board/contentList.js @@ -3,6 +3,8 @@ $(function (){ format: "yyyy-mm-dd", language: "ko" }); + + setMenu(); }) $(document).on('click', '.categoryTr', function (){ if(location.pathname.indexOf("contentSearch")<0){ @@ -127,4 +129,25 @@ function getBoardLog(contentSeq){ } }); } +} + +function setMenu(){ + const categorySeq = getParam("categorySeq"); + openMenu($("[data-categoryseq='"+categorySeq+"']").attr("data-parentseq")); +} + +function getParam(sname) { + const paramAry = location.search.substr(1).split("&"); + for (let i = 0; i < paramAry.length; i++) { + const param = paramAry[i].split("="); + if (param[0] === sname) { return param[1]; } + } +} + +function openMenu(parentSeq){ + if(parentSeq){ + const target = $("[data-categoryseq='"+parentSeq+"']") + target.click(); + openMenu(target.attr("data-parentseq")); + } } \ No newline at end of file diff --git a/src/main/resources/templates/fragments/leftMenu.html b/src/main/resources/templates/fragments/leftMenu.html index b0d2c89..2710b91 100644 --- a/src/main/resources/templates/fragments/leftMenu.html +++ b/src/main/resources/templates/fragments/leftMenu.html @@ -24,8 +24,9 @@
    • @@ -34,8 +35,9 @@
        • @@ -44,13 +46,17 @@
            • -
            • +
            • 등록된 소분류가 없습니다.