diff --git a/layouts/v7/resources/helper.js b/layouts/v7/resources/helper.js index 599f06a7cfa97513e4bd9605f4132f351a9566de..033a07246e72c8fadee73f6987abd66de27fba47 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');