From dd36eda244f3b47da24267ccf1b6a978105cbb38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=84=9D=20=EC=B5=9C?= Date: Thu, 6 Jan 2022 16:24:01 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B2=8C=EC=8B=9C=ED=8C=90=20=EC=A7=84?= =?UTF-8?q?=EC=9E=85=EC=8B=9C=20=EA=B2=8C=EC=8B=9C=ED=8C=90=20=EB=A9=94?= =?UTF-8?q?=EB=89=B4=20=EC=98=A4=ED=94=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/static/js/board/contentList.js | 23 +++++++++++++++++++ .../templates/fragments/leftMenu.html | 20 ++++++++++------ 2 files changed, 36 insertions(+), 7 deletions(-) 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 @@
            • -
            • +
            • 등록된 소분류가 없습니다.