Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
be35e38c
Commit
be35e38c
authored
Jul 06, 2018
by
xishifeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tab切换记录处理
parent
92159c0f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
+18
-7
public.css
public/resource/css/public.css
+4
-0
public.js
public/resource/js/public.js
+14
-7
No files found.
public/resource/css/public.css
View file @
be35e38c
...
...
@@ -239,3 +239,7 @@ a:hover{
max-width
:
750px
;
height
:
600px
;
}
.menu-sub-alink.active-a
{
background-color
:
#ff9419
!important
;
}
public/resource/js/public.js
View file @
be35e38c
...
...
@@ -26,9 +26,15 @@ define(['doT', 'jquery', 'text!temp/menu_template_tpl.html', 'layer'], function
});
}
menu_bar
();
menu_bar
(
function
(){
//回调部分
var
_hash
=
location
.
pathname
.
replace
(
'/admin.php/'
,
'/'
);
var
_tempObj
=
$
(
'[data-href="'
+
_hash
+
'"]'
);
_tempObj
.
addClass
(
'active-a'
).
siblings
().
removeClass
(
'active-a'
);
_tempObj
.
closest
(
'.dropdown-menu'
).
prev
().
attr
(
'aria-expanded'
,
true
).
parents
().
addClass
(
'open'
).
siblings
().
removeClass
(
'open'
);
});
function
menu_bar
()
{
function
menu_bar
(
fn
)
{
var
user_info_obj
=
JSON
.
parse
(
decodeURIComponent
(
sessionStorage
.
getItem
(
'pcUserInfo'
)));
//读取缓存
...
...
@@ -39,7 +45,9 @@ define(['doT', 'jquery', 'text!temp/menu_template_tpl.html', 'layer'], function
var
doTtmpl
=
doT
.
template
(
temp
);
$
(
"#dropdownMenu1"
).
append
(
user_info_obj
[
'name'
]);
$
(
"#menu_bar"
).
html
(
doTtmpl
(
user_info_obj
[
'menu'
]));
//回调
fn
&&
fn
();
}
else
{
$
.
ajax
({
url
:
'/index/getMenu'
,
...
...
@@ -48,11 +56,12 @@ define(['doT', 'jquery', 'text!temp/menu_template_tpl.html', 'layer'], function
data
:
""
,
dataType
:
'json'
,
success
:
function
(
data
)
{
var
_indexMain
=
sessionStorage
.
getItem
(
'menuMainIndex'
);
var
_indexSub
=
sessionStorage
.
getItem
(
'menuSubIndex'
);
var
temp
=
document
.
getElementById
(
'menu_tpl'
).
innerHTML
;
var
doTtmpl
=
doT
.
template
(
temp
);
$
(
"#menu_bar"
).
html
(
doTtmpl
(
data
.
data
.
menu
));
//回调
fn
&&
fn
();
}
});
...
...
@@ -68,8 +77,6 @@ define(['doT', 'jquery', 'text!temp/menu_template_tpl.html', 'layer'], function
e
.
preventDefault
();
e
.
stopPropagation
();
var
_this
=
$
(
this
);
sessionStorage
.
setItem
(
'menuMainIndex'
,
_this
.
parent
().
index
());
sessionStorage
.
setItem
(
'menuSubIndex'
,
_this
.
closest
(
'.menu-main-li'
).
index
());
window
.
open
(
_this
.
data
(
'href'
));
//改为在新标签页打开
//location.href = _this.data('href');
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment