mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-07 18:01:51 +02:00
closes #3000
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
/* 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 = {
|
||||
initialised: false
|
||||
};
|
||||
@@ -69,9 +69,14 @@ define('forum/chats', ['string', 'sounds', 'forum/infinitescroll', 'translator']
|
||||
uid = Chats.getRecipientUid();
|
||||
|
||||
if (app.previousUrl && app.previousUrl.match(/chats/)) {
|
||||
var text = components.get('chat/input').val();
|
||||
ajaxify.go('chats', function() {
|
||||
app.openChat(username, uid);
|
||||
}, true);
|
||||
|
||||
$(window).one('action:chat.loaded', function() {
|
||||
components.get('chat/input').val(text);
|
||||
});
|
||||
} else {
|
||||
window.history.go(-1);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use strict";
|
||||
/* 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 newMessage = false;
|
||||
@@ -205,6 +205,11 @@ define('chat', ['taskbar', 'string', 'sounds', 'forum/chats', 'translator'], fun
|
||||
});
|
||||
|
||||
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));
|
||||
module.close(chatModal);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user