From a5d315d684714c19120885f8ed5f4a247678e88c Mon Sep 17 00:00:00 2001 From: Uma <uma.s@vtiger.com> Date: Thu, 6 Aug 2020 12:00:19 +0530 Subject: [PATCH] showModal and showPopup one time registration is removed --- layouts/v7/resources/helper.js | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/layouts/v7/resources/helper.js b/layouts/v7/resources/helper.js index 599f06a7c..033a07246 100644 --- a/layouts/v7/resources/helper.js +++ b/layouts/v7/resources/helper.js @@ -446,7 +446,7 @@ jQuery.Class("Vtiger_Helper_Js",{ var cb = params.cb; var container = jQuery('.myModal'); - container.one('hidden.bs.modal',function() { + container.on('hidden.bs.modal',function() { container.html(''); window.onbeforeunload = null; }); @@ -794,12 +794,6 @@ jQuery.Class("Vtiger_Helper_Js",{ params = {}; } - // we should hide all existing modal's - var hideModals = (typeof params.hideModals !== 'undefined') ? params.hideModals : true; - if(hideModals) { - this.hideModal(); - } - var defaultParams = app.helper.defaultModalParams(); params = jQuery.extend(defaultParams,params); @@ -808,15 +802,8 @@ jQuery.Class("Vtiger_Helper_Js",{ var container = jQuery('<div id="popupModal" class="modal"></div>'); container.on('hidden.bs.modal',function() { - /** - * if tabindex = -1 then browser will set focus to that element. - * Loading another modal(this has tabindex = -1) on a modal is not moving the focus to new modal. - * We can't remove tabindex from the modals in tpl. So, this is a work around(removing index on show and adding on hide). - */ - jQuery('#helpPageOverlay').attr('tabindex','-1'); - container.html(''); - window.onbeforeunload = null; - }); + container.html('').remove(); + }); if(typeof cb === "function") { container.off('shown.bs.modal'); -- GitLab