added popstate functionality

This commit is contained in:
Julian Lam
2013-05-14 12:04:38 -04:00
parent 0bb0fd5789
commit c351d83418
2 changed files with 13 additions and 8 deletions

View File

@@ -160,14 +160,12 @@ var templates = {};
}());
function load_template(callback, custom_tpl) {
function load_template(callback, url, template) {
var location = document.location || window.location,
rootUrl = location.protocol + '//' + (location.hostname || location.host) + (location.port ? ':' + location.port : '');
var url = location.href.replace(rootUrl +'/', '');
url = (url === '' || url === '/') ? 'home' : url;
jQuery.get(API_URL + url, function(data) {
var tpl = templates.get_custom_map(url);