增加模板加载效果和对应的 js 控制

This commit is contained in:
virusdefender 2015-08-06 23:47:54 +08:00
parent ab63ac652f
commit d6a36fe20c
2 changed files with 7 additions and 3 deletions

View File

@ -20,12 +20,16 @@ define("admin", ["jquery", "avalon"], function($, avalon){
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"
template_url: "template/index/index.html",
hide_loading: function(){
$("#loading-gif").hide();
}
});
});

View File

@ -81,9 +81,9 @@
</ul>
</div>
<!-- admin left end -->
<img src="/static/img/loading.gif" id="loading-gif">
<!-- custom body begin -->
<div ms-include-src="template_url"></div>
<div ms-include-src="template_url" data-include-rendered="hide_loading"></div>
<!-- custom body end -->
</div>
</div>