From 82ec957172483fc7e8160af4a6b22d7c277d1dba Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Wed, 3 Feb 2016 01:51:33 +0500 Subject: [PATCH] closeModal() after group leaving instead unsatisfactory history.back() --- js/twister_directmsg.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/twister_directmsg.js b/js/twister_directmsg.js index 16aaf47..6e3bcc7 100644 --- a/js/twister_directmsg.js +++ b/js/twister_directmsg.js @@ -544,14 +544,15 @@ function initInterfaceDirectMsg() { }); $('.group-messages-control .leave').on('click', function (event) { - var groupAlias = $(event.target).closest('[data-screen-name]').attr('data-screen-name'); + var elemLeave = $(event.target); + var groupAlias = elemLeave.closest('[data-screen-name]').attr('data-screen-name'); event.data = { txtTitle: polyglot.t('сonfirm_group_leaving_header'), txtMessage: polyglot.t('сonfirm_group_leaving_body', {alias: groupAlias}), - cbConfirm: function (groupAlias) { - groupMsgLeaveGroup(groupAlias, function () {history.back();}); + cbConfirm: function (req) { + groupMsgLeaveGroup(req.groupAlias, closeModal, req.elem); }, - cbConfirmReq: groupAlias + cbConfirmReq: {groupAlias: groupAlias, elem: elemLeave} }; confirmPopup(event); });