From cf814dfd188c95c869bfd89046d1335bea5456e9 Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Wed, 29 Mar 2017 20:21:33 +0500 Subject: [PATCH] add hiding of twists' counters in DMs on mark-all-as-read event --- js/twister_directmsg.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/twister_directmsg.js b/js/twister_directmsg.js index e160b45..c21877d 100644 --- a/js/twister_directmsg.js +++ b/js/twister_directmsg.js @@ -179,13 +179,14 @@ function openCommonDMsModal() { modal.self.find('.mark-all-as-read') .css('display', 'inline') .attr('title', polyglot.t('Mark all as read')) - .on('click', function() { + .on('click', function (event) { for (var user in _newDMsPerUser) { if (user[0] !== '*') _newDMsPerUser[user] = 0; } saveDMsToStorage(); $.MAL.updateNewDMsUI(getNewDMsCount()); + $(event.target).closest('.directMessages').find('.direct-messages-list .messages-qtd').hide(); }) ; } @@ -236,13 +237,14 @@ function openGroupMessagesModal(groupAlias) { modal.self.find('.mark-all-as-read') .css('display', 'inline') .attr('title', polyglot.t('Mark all as read')) - .on('click', function() { + .on('click', function (event) { for (var user in _newDMsPerUser) { if (user[0] === '*') _newDMsPerUser[user] = 0; } saveDMsToStorage(); $.MAL.updateNewGroupDMsUI(getNewGroupDMsCount()); + $(event.target).closest('.groupMessages').find('.direct-messages-list .messages-qtd').hide(); }) ; } else {