Merge branch 'dev' into sxw-dev

This commit is contained in:
sxw
2015-08-05 19:51:02 +08:00
13 changed files with 326 additions and 14 deletions

View File

@@ -0,0 +1,31 @@
define("admin", ["jquery", "avalon"], function($, avalon){
function li_active(selector){
$(selector).attr("class", "list-group-item active");
}
function li_inactive(selector){
$(".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");
}
window.onhashchange = function() {
var hash = window.location.hash.substring(1);
if(hash){
li_inactive(".list-group-item");
li_active("#li-" + hash);
vm.template_url = "template/index/" + hash + ".html";
}
};
var vm = avalon.define({
$id: "admin",
template_url: "template/index/index.html"
});
});