Commit c322a590 authored by agping's avatar agping

后台 菜单优化

parent 3626adff
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<!--添加隐藏按钮--> <!--添加隐藏按钮-->
<div id="hide_menu"> <div id="hide_menu">
<span class="width-136-hide"> <span class="width-136-hide">
隐藏 隐藏<img src="/resource/image/icon_down@2x.png" class="text-icon-hide"/>
</span> </span>
</div> </div>
......
...@@ -129,13 +129,38 @@ a:hover{ ...@@ -129,13 +129,38 @@ a:hover{
} }
/*菜单图标的样式*/ /*菜单图标的样式*/
#icon_more_menu{ #icon_more_menu{
width: 12px; width: 13px;
height: 13px; height: 14px;
margin-left: 10px; margin-left: 10px;
float: right;
margin-top: 2px;
background-image: url(/resource/image/icon_more@2x.png);
background-position: center;
background-repeat: no-repeat;
background-size: 13px 14px;
}
.open>a #icon_more_menu{
width: 14px;
height: 11px;
margin-left: 10px;
float: right;
margin-top: 2px;
background-image: url(/resource/image/icon_down02@2x.png);
background-position: center;
background-repeat: no-repeat;
background-size: 14px 11px;
} }
.glyphicon-zhanwei{ .glyphicon-zhanwei{
margin-left:10px; margin-left:10px;
} }
/*隐藏 图标 样式*/
.text-icon-hide{
width: 16px;
height: 9px;
margin-left: 4px;
}
.sidebar-nav li{ .sidebar-nav li{
border-bottom: 1px solid #1a1a1a; border-bottom: 1px solid #1a1a1a;
} }
......
...@@ -33,6 +33,8 @@ define(['doT', 'jquery', 'text!temp/menu_template_tpl.html', 'layer'], function ...@@ -33,6 +33,8 @@ define(['doT', 'jquery', 'text!temp/menu_template_tpl.html', 'layer'], function
var _tempObj = $('[data-href="'+_hash+'"]'); var _tempObj = $('[data-href="'+_hash+'"]');
_tempObj.addClass('active-a').siblings().removeClass('active-a'); _tempObj.addClass('active-a').siblings().removeClass('active-a');
_tempObj.closest('.dropdown-menu').prev().attr('aria-expanded', true).parents().addClass('open').siblings().removeClass('open'); _tempObj.closest('.dropdown-menu').prev().attr('aria-expanded', true).parents().addClass('open').siblings().removeClass('open');
console.log(_tempObj.closest('.dropdown-menu').prev().attr('aria-expanded', true).parents().attr("class"));
}); });
function menu_bar(fn) { function menu_bar(fn) {
...@@ -94,15 +96,14 @@ define(['doT', 'jquery', 'text!temp/menu_template_tpl.html', 'layer'], function ...@@ -94,15 +96,14 @@ define(['doT', 'jquery', 'text!temp/menu_template_tpl.html', 'layer'], function
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
var _this = $(this); var _this = $(this);
if($.trim(_this.html())=='隐藏'){ if($.trim(_this.html()).indexOf("隐藏")!=-1){
$('#sidebar-wrapper').hide(); $('#sidebar-wrapper').hide();
$('.width-136-hide').html('显示'); _this.html('显示<img src="/resource/image/icon_down_hide@2x.png" class="text-icon-hide"/>');
_this.html('显示');
console.log(2); console.log(2);
// $("#page-content-wrapper").css("width","88%"); // $("#page-content-wrapper").css("width","88%");
}else{ }else{
$('#sidebar-wrapper').show(); $('#sidebar-wrapper').show();
_this.html('隐藏'); _this.html('隐藏<img src="/resource/image/icon_down@2x.png" class="text-icon-hide"/>');
// $("#page-content-wrapper").css("width","88%"); // $("#page-content-wrapper").css("width","88%");
} }
......
...@@ -6,8 +6,10 @@ ...@@ -6,8 +6,10 @@
<a href="javascript:;" ><span class="glyphicon glyphicon-credit-card" aria-hidden="true"></span> <span class="span-list">[%= it[item]["title"] %]</span></a> <a href="javascript:;" ><span class="glyphicon glyphicon-credit-card" aria-hidden="true"></span> <span class="span-list">[%= it[item]["title"] %]</span></a>
[% } else { %] [% } else { %]
<a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown"> <span class="glyphicon glyphicon-credit-card" aria-hidden="true"></span><span class="span-list">[%= it[item]["title"] %]</span> <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown"> <span class="glyphicon glyphicon-credit-card" aria-hidden="true"></span><span class="span-list">[%= it[item]["title"] %]</span>
<span class="glyphicon glyphicon-hand-down" aria-hidden="true"></span></a> <!--<span class="glyphicon glyphicon-chevron-down" aria-hidden="true"></span>-->
<!--<img src="/resource/image/icon_more@2x.png" id="icon_more_menu"/>--> <span id="icon_more_menu">
</span></a>
<!--<img src="/resource/image/icon_more@2x.png" id=""/>-->
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
[% for(var item_menu in it[item]["_child"]){ %] [% for(var item_menu in it[item]["_child"]){ %]
<li><a href="javascript:;" target="_blank" class="menu-sub-alink" data-href="/[%= it[item]['_child'][item_menu]['name'] %]"><span class="glyphicon-zhanwei"></span> <span class="span-list">[%= it[item]["_child"][item_menu]['title'] %]</span></a></li> <li><a href="javascript:;" target="_blank" class="menu-sub-alink" data-href="/[%= it[item]['_child'][item_menu]['name'] %]"><span class="glyphicon-zhanwei"></span> <span class="span-list">[%= it[item]["_child"][item_menu]['title'] %]</span></a></li>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment