修复后台左侧导航栏的 hash 和 li class 还有模板路径对应关系错误的 bug
This commit is contained in:
@@ -7,24 +7,11 @@ define("admin", ["jquery", "avalon"], function($, avalon){
|
||||
$(".list-group-item").attr("class", "list-group-item");
|
||||
}
|
||||
|
||||
var hash = window.location.hash.substring(1);
|
||||
|
||||
if(hash){
|
||||
li_active("#li-" + hash);
|
||||
}else {
|
||||
li_active("#li-index");
|
||||
function show_template(url){
|
||||
$("#loading-gif").show();
|
||||
vm.template_url = url;
|
||||
}
|
||||
|
||||
window.onhashchange = function() {
|
||||
var hash = window.location.hash.substring(1);
|
||||
if(hash){
|
||||
li_inactive(".list-group-item");
|
||||
li_active("#li-" + hash);
|
||||
$("#loading-gif").show();
|
||||
vm.template_url = "template/index/" + hash + ".html";
|
||||
}
|
||||
};
|
||||
|
||||
var vm = avalon.define({
|
||||
$id: "admin",
|
||||
template_url: "template/index/index.html",
|
||||
@@ -32,4 +19,24 @@ define("admin", ["jquery", "avalon"], function($, avalon){
|
||||
$("#loading-gif").hide();
|
||||
}
|
||||
});
|
||||
|
||||
var hash = window.location.hash.substring(1);
|
||||
|
||||
if(hash){
|
||||
li_active("#li-" + hash.replace("/", "-"));
|
||||
show_template("template/" + hash + ".html");
|
||||
}else {
|
||||
li_active("#li-index-index");
|
||||
}
|
||||
|
||||
window.onhashchange = function() {
|
||||
var hash = window.location.hash.substring(1);
|
||||
if(hash){
|
||||
li_inactive(".list-group-item");
|
||||
li_active("#li-" + hash.replace("/", "-"));
|
||||
show_template("template/" + hash + ".html");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user