From 7e35f901b8b60605b6cde94467033921ab582fc5 Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Tue, 28 Aug 2018 09:02:35 +0200 Subject: [PATCH] [docs] fix `this` scope in the chat example `user is typing` messages were not properly removed Closes #3291 --- examples/chat/public/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/chat/public/main.js b/examples/chat/public/main.js index 5af5b89f8c..f20614a89a 100644 --- a/examples/chat/public/main.js +++ b/examples/chat/public/main.js @@ -108,7 +108,7 @@ $(function() { // Removes the visual chat typing message const removeChatTyping = (data) => { - getTypingMessages(data).fadeOut(() => { + getTypingMessages(data).fadeOut(function () { $(this).remove(); }); } @@ -171,7 +171,7 @@ $(function() { // Gets the 'X is typing' messages of a user const getTypingMessages = (data) => { - return $('.typing.message').filter(i => { + return $('.typing.message').filter(function (i) { return $(this).data('username') === data.username; }); }