minor cleanups.

This commit is contained in:
Aziz Khoury
2014-05-16 09:39:46 -04:00
parent 230b4a0952
commit 0e0f66ba9e
2 changed files with 9 additions and 9 deletions

View File

@@ -24,7 +24,7 @@ var socket,
reconnecting = false;
// Rejoin room that was left when we disconnected
var url_parts = document.location.pathname.slice(RELATIVE_PATH.length).split('/').slice(1);
var url_parts = window.location.pathname.slice(RELATIVE_PATH.length).split('/').slice(1);
var room;
switch(url_parts[0]) {
@@ -513,7 +513,9 @@ var socket,
$('document').ready(function () {
var url = window.location.pathname.slice(1),
search = window.location.search,
tpl_url = ajaxify.getTemplateMapping(url);
hash = window.location.hash,
tpl_url = ajaxify.getTemplateMapping(url),
$window = $(window);
url = url.replace(/\/$/, "");
@@ -521,7 +523,7 @@ var socket,
url = url.slice(RELATIVE_PATH.length);
}
$(window).trigger('action:ajaxify.start', {
$window.trigger('action:ajaxify.start', {
url: url
});
@@ -533,11 +535,11 @@ var socket,
$('#logout-link').on('click', app.logout);
$(window).blur(function(){
$window.blur(function(){
app.isFocused = false;
});
$(window).focus(function(){
$window.focus(function(){
app.isFocused = true;
app.alternatingTitle('');
});
@@ -550,21 +552,20 @@ var socket,
ajaxify.widgets.render(tpl_url, url);
if (window.history && window.history.replaceState) {
var hash = window.location.hash ? window.location.hash : '';
window.history.replaceState({
url: url + search + hash
}, url, RELATIVE_PATH + '/' + url + search + hash);
}
ajaxify.loadScript(tpl_url, function() {
$(window).trigger('action:ajaxify.end', {
$window.trigger('action:ajaxify.end', {
url: url
});
});
});
};
showWelcomeMessage = location.href.indexOf('loggedin') !== -1;
showWelcomeMessage = window.location.href.indexOf('loggedin') !== -1;
app.loadConfig();
app.alternatingTitle('');