fix(footer): ensure window.env is accessible from static pages, so we

can get deferred scripts on frontpage (esp google analytics)
This commit is contained in:
Tyler Renelle 2014-02-03 11:43:03 -07:00
parent 43d05a54a3
commit 67ee011aa3
3 changed files with 9 additions and 4 deletions

View file

@ -1,6 +1,7 @@
"use strict";
habitrpg.controller("FooterCtrl", ['$scope', '$rootScope', 'User', '$http', 'Notification', 'API_URL',
(typeof habitrpg !== 'undefined' ? habitrpg : habitrpgStatic)
.controller("FooterCtrl", ['$scope', '$rootScope', 'User', '$http', 'Notification', 'API_URL',
function($scope, $rootScope, User, $http, Notification, API_URL) {
/**

View file

@ -84,7 +84,8 @@
"js/static.js",
"js/services/notificationServices.js",
"bower_components/habitrpg-shared/script/userServices.js",
"js/controllers/authCtrl.js"
"js/controllers/authCtrl.js",
"js/controllers/footerCtrl.js"
],
"css": [
"bower_components/bootstrap/docs/assets/css/bootstrap.css",

View file

@ -1,12 +1,15 @@
//Trick needed to pass 'env' to ./layout
block vars
doctype 5
html
html(ng-app='habitrpgStatic')
head
block title
title=env.t('titleIndex')
script(type='text/javascript').
window.env = !{JSON.stringify(env)};
link(rel='shortcut icon', href='#{env.getBuildUrl("favicon.ico")}?v=2')
meta(charset='utf-8')
@ -18,7 +21,7 @@ html
$.getScript("//s7.addthis.com/js/250/addthis_widget.js#pubid=lefnire");
body
div(ng-app='habitrpgStatic',ng-controller='AuthCtrl',style='margin-top:60px;')
div(ng-controller='AuthCtrl',style='margin-top:60px;')
include ./login-modal
.navbar.navbar-inverse.navbar.navbar-inverse.navbar-fixed-top
.navbar-inner