removing persona-specific logic from chats from Persona

main
Julian Lam 8 years ago
parent 7fda459594
commit ddf2795284

@ -1,20 +0,0 @@
define('persona/chats', ['components', 'forum/chats'], function(components, coreChats) {
var Chats = {};
Chats.init = function() {
var env = utils.findBootstrapEnvironment();
if (ajaxify.data.hasOwnProperty('roomId') && (env === 'sm' || env === 'xs')) {
app.openChat(ajaxify.data.roomId, ajaxify.data.uid);
}
components.get('chat/recent').on('click', '[component="chat/recent/room"]', function(e) {
env = utils.findBootstrapEnvironment();
if (env === 'xs' || env === 'sm') {
app.openChat($(this).attr('data-roomid'));
} else {
coreChats.switchChat($(this).attr('data-roomid'));
}
});
};
return Chats;
});

@ -26,11 +26,7 @@ $(document).ready(function() {
NProgress.done();
setupHoverCards();
if (data.url && data.url.match('^user/.+/chats')) {
require(['persona/chats'], function(chats) {
chats.init();
});
} else if (data.url && data.url.match('user/')) {
if (data.url && data.url.match('user/')) {
setupFavouriteButtonOnProfile();
}
});

Loading…
Cancel
Save