fixed admin js error, was trying to use socket. before it was connected

This commit is contained in:
Baris Soner Usakli
2013-07-14 00:32:04 -04:00
parent 7191d94099
commit bfc87a8178

View File

@@ -98,6 +98,8 @@ var socket,
window.location.reload(); window.location.reload();
}); });
} }
app.enter_room('global');
}, },
async: false async: false
}); });
@@ -194,7 +196,8 @@ var socket,
app.current_room = null; app.current_room = null;
app.enter_room = function(room) { app.enter_room = function(room) {
if (app.current_room === room) return; if (app.current_room === room)
return;
socket.emit('event:enter_room', { socket.emit('event:enter_room', {
'enter': room, 'enter': room,
@@ -234,9 +237,6 @@ var socket,
loadConfig(); loadConfig();
app.enter_room('global');
// On menu click, change "active" state // On menu click, change "active" state
var menuEl = document.querySelector('.nav'), var menuEl = document.querySelector('.nav'),
liEls = menuEl.querySelectorAll('li'), liEls = menuEl.querySelectorAll('li'),