Skip to content

Commit 18e555a

Browse files
committed
Corrected errors with nav links and (i believe) twitter widgets. did not change google script but it seems to be working now.
1 parent ee689cd commit 18e555a

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

war/js/main.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ function detectmob() {
120120
}
121121

122122
function setNavigation() {
123-
$(".nav a").removeClass('active');
123+
$(".nav li").removeClass('active');
124124
var path = window.location.pathname;
125125

126126
$(".nav a").each(function() {
@@ -162,13 +162,21 @@ function loadFacebook() {
162162
}
163163

164164
function loadTwitterWidget () {
165-
var js, fjs = document.getElementsByTagName("script")[0];
166-
if (document.getElementById("twitter-wjs")) return;
165+
var js, fjs = document.getElementsByTagName("script")[0],
166+
t = window.twtter || {};
167+
if (document.getElementById("twitter-wjs")) return t;
167168
js = document.createElement("script");
168169
js.async = true;
169170
js.id = "twitter-wjs";
170171
js.src = "//platform.twitter.com/widgets.js";
171172
fjs.parentNode.insertBefore(js, fjs);
173+
174+
t._e = [];
175+
t.ready = function(f) {
176+
t._e.push(f);
177+
};
178+
179+
return t;
172180
}
173181

174182

@@ -186,9 +194,7 @@ function reloadSocial() {
186194
// http://www.blackfishweb.com/blog/asynchronously-loading-twitter-google-facebook-and-linkedin-buttons-and-widgets-ajax-bonus
187195

188196
// Twitter widget
189-
twttr.widgets.load(
190-
document.getElementById('social-links')
191-
);
197+
twttr.widgets.load();
192198

193199
// Facebook
194200
if (typeof (FB) != 'undefined') {
@@ -199,8 +205,7 @@ function reloadSocial() {
199205
})
200206
}
201207

202-
// Google - Note that the google button will not show if you are opening the page from disk
203-
// it needs to be http(s)
208+
// Google+; Note that google button will not show if page is opened from disk
204209
if (typeof (gapi) != 'undefined') {
205210
delete gapi;
206211
$.getScript('//apis.google.com/js/plusone.js');

0 commit comments

Comments
 (0)