Browse Source

add hiding of twists' counters in DMs on mark-all-as-read event

readme-update
Simon Grim 8 years ago
parent
commit
cf814dfd18
  1. 6
      js/twister_directmsg.js

6
js/twister_directmsg.js

@ -179,13 +179,14 @@ function openCommonDMsModal() {
modal.self.find('.mark-all-as-read') modal.self.find('.mark-all-as-read')
.css('display', 'inline') .css('display', 'inline')
.attr('title', polyglot.t('Mark all as read')) .attr('title', polyglot.t('Mark all as read'))
.on('click', function() { .on('click', function (event) {
for (var user in _newDMsPerUser) { for (var user in _newDMsPerUser) {
if (user[0] !== '*') if (user[0] !== '*')
_newDMsPerUser[user] = 0; _newDMsPerUser[user] = 0;
} }
saveDMsToStorage(); saveDMsToStorage();
$.MAL.updateNewDMsUI(getNewDMsCount()); $.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') modal.self.find('.mark-all-as-read')
.css('display', 'inline') .css('display', 'inline')
.attr('title', polyglot.t('Mark all as read')) .attr('title', polyglot.t('Mark all as read'))
.on('click', function() { .on('click', function (event) {
for (var user in _newDMsPerUser) { for (var user in _newDMsPerUser) {
if (user[0] === '*') if (user[0] === '*')
_newDMsPerUser[user] = 0; _newDMsPerUser[user] = 0;
} }
saveDMsToStorage(); saveDMsToStorage();
$.MAL.updateNewGroupDMsUI(getNewGroupDMsCount()); $.MAL.updateNewGroupDMsUI(getNewGroupDMsCount());
$(event.target).closest('.groupMessages').find('.direct-messages-list .messages-qtd').hide();
}) })
; ;
} else { } else {

Loading…
Cancel
Save