@ -11,20 +11,3 @@
|
|||||||
<script src="/public/admin/js/artDialog/jquery.artDialog.js?skin=default"></script>
|
<script src="/public/admin/js/artDialog/jquery.artDialog.js?skin=default"></script>
|
||||||
<script src="/public/js/common.js"></script>
|
<script src="/public/js/common.js"></script>
|
||||||
<script src="/public/admin/js/admin.js"></script>
|
<script src="/public/admin/js/admin.js"></script>
|
||||||
<script>
|
|
||||||
$(function() {
|
|
||||||
var pathname = location.pathname; // admin/t
|
|
||||||
var search = location.search; // ?t=xxx, 如果有?page呢
|
|
||||||
var fullPath = pathname;
|
|
||||||
if(search.indexOf("?t=") >= 0) {
|
|
||||||
var fullPath = pathname + search; // /admin/t?t=xxx
|
|
||||||
}
|
|
||||||
|
|
||||||
$("#nav > li").removeClass("active");
|
|
||||||
// 自己
|
|
||||||
var $thisLi = $('#nav a[href^="' + fullPath + '"]').parent();
|
|
||||||
$thisLi.addClass("active");
|
|
||||||
// 父也active
|
|
||||||
$thisLi.parent().parent().addClass('active');
|
|
||||||
});
|
|
||||||
</script>
|
|
@ -274,7 +274,41 @@ function goNowToDatetime(goNow) {
|
|||||||
!function ($) {
|
!function ($) {
|
||||||
$(function(){
|
$(function(){
|
||||||
|
|
||||||
// life
|
//navigation
|
||||||
|
!function ($) {
|
||||||
|
/**
|
||||||
|
* description
|
||||||
|
* every href must begin with "?t="
|
||||||
|
*/
|
||||||
|
//initial
|
||||||
|
function getParameterByName(name, queryString) {
|
||||||
|
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); //address array [] condiion
|
||||||
|
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
|
||||||
|
results = regex.exec(queryString);
|
||||||
|
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
|
||||||
|
}
|
||||||
|
|
||||||
|
var pathname = window.location.pathname; // admin/t
|
||||||
|
var search = window.location.search; // ?t=xxx
|
||||||
|
var fullPath = pathname;
|
||||||
|
|
||||||
|
//test case
|
||||||
|
//http://localhost:9000/admin/t?p=0&t=email/sendToUsers
|
||||||
|
//t=email/sendToUsers and t=email/send
|
||||||
|
var paramId = getParameterByName("t",window.location.search)
|
||||||
|
if(paramId !== "") {
|
||||||
|
var fullPath = pathname + "?t=" + paramId; // /admin/t?t=xxx
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#nav > li").removeClass("active");
|
||||||
|
|
||||||
|
var $thisLi = $('#nav a[href="' + fullPath + '"]').parent();
|
||||||
|
// 自己
|
||||||
|
$thisLi.addClass("active");
|
||||||
|
// 父也active
|
||||||
|
$thisLi.parent().parent().addClass('active');
|
||||||
|
|
||||||
|
// event binding
|
||||||
$(".nav li > a").click(function(e) {
|
$(".nav li > a").click(function(e) {
|
||||||
$p = $(this).closest("ul");
|
$p = $(this).closest("ul");
|
||||||
var $li = $(this).closest("li");
|
var $li = $(this).closest("li");
|
||||||
@ -289,6 +323,7 @@ function goNowToDatetime(goNow) {
|
|||||||
$li.addClass("active");
|
$li.addClass("active");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}($);
|
||||||
|
|
||||||
// sort
|
// sort
|
||||||
$(".th-sortable").click(function() {
|
$(".th-sortable").click(function() {
|
||||||
|
Reference in New Issue
Block a user