<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="/WEB-INF/jsp/includes.jsp" %>
<div class="sidebar" id="back_left_id">
    <div class="panel">
        <div class="panel-body">
            <div class="sidebar-nav manage-nav ">
                <ul class="nav-list backend_manager ">
                    <li class="nav-item" id="menu110">
                        <a class="nav-text" content="user" href="${contextPath}/platform/user/index.mooc">
                            <i class="icon-nav icon-team"></i>用户管理</a>
                    </li>
                    <li class="nav-item" id="menu111">
                        <a class="nav-text" content="unit" href="${contextPath}/platform/queryunit.mooc">
                            <i class="icon-nav icon-content"></i>课程内容</a>
                    </li>
                    <!--
                    <li class="nav-item" id="menu112">
                        <a class="nav-text" content="live" href="${contextPath}/.mooc">
                            <i class="icon-nav  icon-cmsg"></i>直播课</a>
                    </li> -->
                    <br>
                    <br><br><br><br><br><br>
                    <br><br><br>
                    <br><br><br>
                    <br><br><br>
                    <br><br><br>
                    <br><br><br>
                    <br><br><br>
                    <br><br><br>
                </ul>
            </div>
        </div>
    </div>
</div>
<script>
var curDignity = 10;
$(function () {

    //侧栏导航
    $(".nav-text").click(function () {
        selectMenuEvent($(this));
    });
    $(".sub-nav-text").click(function () {
        $(this).parent().siblings().find(".current").removeClass("current");

        $(this).addClass("current");
    });

    selectMenu();
    function selectMenu() {
        var currentMenu = $("#currentMenu").val();
        var $target = $(".nav-item").find("a[content='" + currentMenu + "']");
        selectMenuEvent($target)
    }
})

function selectMenuEvent($target) {
    var $li;
    if ($target.hasClass('sub-nav-text')) {
        $li = $target.parent().parent().parent().children().eq(0);
    } else {
        $li = $target.parent();
    }
    if ($li.hasClass("open-up")) {
        $li.removeClass("open-up");
        $li.children(".sub-nav").slideUp();
    } else {
        $li.siblings().removeClass("open-up");
        $li.siblings().find(".nav-text").removeClass("current");
        $li.siblings().find(".sub-nav").slideUp();
        $li.addClass("current");
        $target.addClass("current");
        $li.addClass("open-up");
        if ($target.hasClass('sub-nav-text')) {
            $li.parent().children(".sub-nav").slideDown();
        } else {
            $li.children(".sub-nav").slideDown();
        }
    }
}
</script>