<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="manageMenuTree.aspx.cs" EnableEventValidation="false" Inherits="Web.Wpdcc.manageMenuTree" %>

<!DOCTYPE html>
<head runat="server">
    <!--#include file = "../Css/head.htm" -->
</head>
<body>
     <div class="main-content-inner">
        <!-- #section:basics/content.breadcrumbs -->
        <div class="breadcrumbs" id="breadcrumbs">
            <script type="text/javascript">
                try { ace.settings.check('breadcrumbs', 'fixed') } catch (e) { }
            </script>
           <ul class="breadcrumb">
                <li>
                    <i class="ace-icon fa  fa-desktop"></i>
                    <a href="welcome.aspx">主页</a>
                </li>
                <li>布局管理</li>
            </ul>
            <a href="bigClass.aspx" class="btn btn-primary btn-xs pull-right" style="margin:5px 15px 0 0;">
												<i class="ace-icon fa fa-exclamation-circle align-top bigger-125"></i>
												查看所有栏目</a>&nbsp;&nbsp;
            <a href="manageMenu.aspx" class="btn btn-primary btn-xs pull-right" style="margin:5px 15px 0 0;">
												<i class="ace-icon glyphicon glyphicon-refresh align-top bigger-125"></i>
												切换到列表模式</a>
            <!-- /.breadcrumb -->

            <!-- /section:basics/content.searchbox -->
        </div>
        <!-- /section:basics/content.breadcrumbs -->
        <div class="page-content">
            <div class="row">
                <div class="col-xs-12">
                    <!-- PAGE CONTENT BEGINS -->
    <div class="edit-func-box func-box">
        <form id="form1" runat="server">
        <div class="bd">
            <table width="100%">
                <tr>
                    <td style="width: 220px; vertical-align: top;">
                        <div class="tree_hd" >
                            <a class="lm-add" href='manageMenuEditor.aspx?parentId=0&menuMode=1'"'> + 添加布局</a>
                        </div>
                        <div id="MenuTree" runat="server" >
                        </div>
                    </td>
                    <td style="vertical-align:top;">
                        <div class="embed-responsive">
                       <iframe id="itemFrame" name="itemFrame" allowtransparency="true" scrolling="auto"
                                class="embed-responsive-item" frameborder="0" src="ManageMenuItem.aspx"></iframe></div>
                    </td>
                </tr>
            </table>
        </div>
            <input id="hdMenuId" type="Hidden" runat="server" value="0" />
            <asp:LinkButton ID="lbtnHidden" runat="server" OnClick="lbtnHidden_Click"> </asp:LinkButton>
        </form>
    </div>
 <!-- PAGE CONTENT ENDS -->
                </div>
            </div>
        </div>
        <!-- /.page-content -->
    </div>
    <!--#include file = "../Css/foot.htm" -->
    <script type="text/javascript" src="../Js/jquery.tree.js"></script>
    <script type="text/javascript">
        jQuery(function ($) {
            //加载树
            $('#files').tree({});

            //新增布局
            $(".icon-add").click(function () {
                return true;
            }).fancybox({
                'hideOnOverlayClick': false,
                'type': 'iframe',
                'padding': '0'
            });
            $(".lm-add").click(function () {
                return true;
            }).fancybox({
                'hideOnOverlayClick': false,
                'type': 'iframe',
                'padding': '0'
            });

            //布局编辑
            $(".icon-edit").click().fancybox({
                'hideOnOverlayClick': false,
                'type': 'iframe',
                'padding': '0'
            });

            //右边列表自适应高度
            $(".embed-responsive").css("padding-bottom", $(window).height() - 86);
            $(".tree").css("max-height", $(window).height() - 182);
            $(window).resize(function () {
                $(".embed-responsive").css("padding-bottom", $(window).height() - 86);
                $(".tree").css("max-height", $(window).height() - 182);
            });

            //选中菜单项加背景色
            $('.menuItem').on('click', function () {
                $(this).next().show();
                $('.tree li').removeClass('bg');
                $(this).parents('li').eq(0).addClass('bg');
            });

            //鼠标滑过加背景色，显示操作按钮并防抖动
            $('.menuItem').hover(function () {
                $(this).addClass('bg').next().show();
            }, function () {
                $(this).removeClass('bg').next().hide();
            });
            //$('.menuItem span').hover(function (event) {
            //    $(event.target).parents('a').next().show();
            //    $(this).parents('a').addClass('bg');
            //}, function (event) {
            //    $(event.target).parents('a').next().hide();
            //    $(this).parents('a').removeClass('bg');
            //});
            $('.edit').hover(function (event) {
                $(event.target).show();
                $(this).prev('a').addClass('bg');
            }, function (event) {
                $('.edit').hide();
                $(this).prev('a').removeClass('bg');
            });
            $('.edit a i').hover(function (event) {
                $(this).parent().parent().show();
            }, function (event) {
                $('.edit').hide();
            });
        })

        //删除栏目
        function fnDel(id) {
            document.getElementById("hdMenuId").value = id;
            var rtn = confirm("你确定要删除该页及其下的所有栏目和子频道吗？");
            if (rtn) {
                <%= ClientScript.GetPostBackEventReference(lbtnHidden, "del") %>;
            }
            return rtn;
        };
    </script>
</body>
</html>
