diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js index d633e9688c..ef60865826 100644 --- a/public/src/ajaxify.js +++ b/public/src/ajaxify.js @@ -37,8 +37,8 @@ var ajaxify = {}; $(window).off('scroll'); - $('body').trigger('action:ajaxify.start', { url: url }); - $('body').trigger('action:ajaxifying', {url: url}); // Deprecated as of v0.4.0 + $(window).trigger('action:ajaxify.start', { url: url }); + $(window).trigger('action:ajaxifying', {url: url}); // Deprecated as of v0.4.0 if ($('#content').hasClass('ajaxifying')) { templates.cancelRequest(); @@ -121,7 +121,7 @@ var ajaxify = {}; } app.refreshTitle(url); - $('body').trigger('action:ajaxify.end', { url: url }); + $(window).trigger('action:ajaxify.end', { url: url }); }, url); return true; diff --git a/public/src/app.js b/public/src/app.js index 30916fbca5..50f181a99e 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -9,7 +9,6 @@ var socket, (function () { var showWelcomeMessage = false; - var body = $('body'); app.loadConfig = function() { $.ajax({ @@ -42,7 +41,7 @@ var socket, fields: ['username', 'picture', 'userslug'] }, app.updateHeader); - body.trigger('action:connected'); + $(window).trigger('action:connected'); }); socket.on('event:alert', function (data) { @@ -82,7 +81,7 @@ var socket, app.enterRoom(room, true); socket.emit('meta.reconnected'); - body.trigger('action:reconnected'); + $(window).trigger('action:reconnected'); setTimeout(function() { reconnectEl.removeClass('active').addClass("hide"); @@ -95,7 +94,7 @@ var socket, }); socket.on('event:disconnect', function() { - body.trigger('action:disconnected'); + $(window).trigger('action:disconnected'); socket.socket.connect(); }); diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js index 597bbad79f..f877870b1e 100644 --- a/public/src/forum/topic.js +++ b/public/src/forum/topic.js @@ -8,7 +8,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) { } } - $('body').on('action:ajaxifying', function(ev, data) { + $(window).on('action:ajaxifying', function(ev, data) { if(data.url.indexOf('topic') === 0) { $('.pagination-block a').off('click').on('click', function() {