From 831933bc87c36f227a13fed75a02ccdc6a62006e Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 25 Jan 2021 21:59:01 +0300 Subject: [PATCH] [Mobile] Fix Bug 48004 --- .../mobile/lib/controller/Collaboration.js | 45 ++++++++++--------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/apps/common/mobile/lib/controller/Collaboration.js b/apps/common/mobile/lib/controller/Collaboration.js index 0bd465c2f..fb668774f 100644 --- a/apps/common/mobile/lib/controller/Collaboration.js +++ b/apps/common/mobile/lib/controller/Collaboration.js @@ -893,28 +893,31 @@ define([ }); mainView.hideNavbar(); } else { - me.modalViewComment = uiApp.popover( - '
' + - '
' + - me.view.getTemplateContainerViewComments() + - '
' + - '
', - $$('#toolbar-collaboration') - ); - this.picker = $$(me.modalViewComment); - var $overlay = $('.modal-overlay'); - - $$(this.picker).on('opened', function () { - $overlay.on('removeClass', function () { - if (!$overlay.hasClass('modal-overlay-visible')) { - $overlay.addClass('modal-overlay-visible') - } + if (!me.openModal) { + me.modalViewComment = uiApp.popover( + '
' + + '
' + + me.view.getTemplateContainerViewComments() + + '
' + + '
', + $$('#toolbar-collaboration') + ); + this.picker = $$(me.modalViewComment); + var $overlay = $('.modal-overlay'); + me.openModal = true; + $$(this.picker).on('opened', function () { + $overlay.on('removeClass', function () { + if (!$overlay.hasClass('modal-overlay-visible')) { + $overlay.addClass('modal-overlay-visible') + } + }); + }).on('close', function () { + $overlay.off('removeClass'); + $overlay.removeClass('modal-overlay-visible'); + $('.popover').remove(); + me.openModal = false; }); - }).on('close', function () { - $overlay.off('removeClass'); - $overlay.removeClass('modal-overlay-visible'); - $('.popover').remove(); - }); + } } me.getView('Common.Views.Collaboration').renderViewComments(me.showComments, me.indexCurrentComment); $('.prev-comment').single('click', _.bind(me.onViewPrevComment, me));