v1.18.x
psychobunny 10 years ago
parent c188fa2a1f
commit 1d94b6a96f

@ -2,7 +2,7 @@
/* globals define, app, ajaxify, utils, socket, templates */ /* globals define, app, ajaxify, utils, socket, templates */
define('forum/chats', ['string', 'sounds', 'forum/infinitescroll', 'translator'], function(S, sounds, infinitescroll, translator) { define('forum/chats', ['components', 'string', 'sounds', 'forum/infinitescroll', 'translator'], function(components, S, sounds, infinitescroll, translator) {
var Chats = { var Chats = {
initialised: false initialised: false
}; };
@ -69,9 +69,14 @@ define('forum/chats', ['string', 'sounds', 'forum/infinitescroll', 'translator']
uid = Chats.getRecipientUid(); uid = Chats.getRecipientUid();
if (app.previousUrl && app.previousUrl.match(/chats/)) { if (app.previousUrl && app.previousUrl.match(/chats/)) {
var text = components.get('chat/input').val();
ajaxify.go('chats', function() { ajaxify.go('chats', function() {
app.openChat(username, uid); app.openChat(username, uid);
}, true); }, true);
$(window).one('action:chat.loaded', function() {
components.get('chat/input').val(text);
});
} else { } else {
window.history.go(-1); window.history.go(-1);
} }

@ -1,7 +1,7 @@
"use strict"; "use strict";
/* globals app, config, define, socket, templates, utils, ajaxify */ /* globals app, config, define, socket, templates, utils, ajaxify */
define('chat', ['taskbar', 'string', 'sounds', 'forum/chats', 'translator'], function(taskbar, S, sounds, Chats, translator) { define('chat', ['components', 'taskbar', 'string', 'sounds', 'forum/chats', 'translator'], function(components, taskbar, S, sounds, Chats, translator) {
var module = {}; var module = {};
var newMessage = false; var newMessage = false;
@ -205,6 +205,11 @@ define('chat', ['taskbar', 'string', 'sounds', 'forum/chats', 'translator'], fun
}); });
function gotoChats() { function gotoChats() {
var text = components.get('chat/input').val();
$(window).one('action:ajaxify.end', function() {
components.get('chat/input').val(text);
});
ajaxify.go('chats/' + utils.slugify(username)); ajaxify.go('chats/' + utils.slugify(username));
module.close(chatModal); module.close(chatModal);
} }

Loading…
Cancel
Save