From 6e1e801ea056a3e82a29305f2537ceae1ecd9d8c Mon Sep 17 00:00:00 2001 From: Imesh Chandrasiri Date: Sat, 14 Jan 2017 23:50:34 +0530 Subject: [PATCH] Fix for multiple popup issue --- .../app/units/cdmf.unit.lib.qrcode/qrcode.hbs | 7 ----- .../cdmf.unit.ui.modal/public/js/modal.js | 26 +++++++++++++------ 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.lib.qrcode/qrcode.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.lib.qrcode/qrcode.hbs index d63ee909652..07ee1b4801a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.lib.qrcode/qrcode.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.lib.qrcode/qrcode.hbs @@ -67,11 +67,4 @@ }); } - {{/zone}} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.modal/public/js/modal.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.modal/public/js/modal.js index 0e97b964b73..29c29bf7a86 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.modal/public/js/modal.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.modal/public/js/modal.js @@ -20,15 +20,15 @@ var modalDialog = (function () { var publicMethoads = {}; publicMethoads.header = function (headerText) { - $("#modal-title-text").html(headerText); + $("#basic-modal-view #modal-title-text").html(headerText); }; publicMethoads.content = function (contentText) { - $("#modal-content-text").html(contentText); + $("#basic-modal-view #modal-content-text").html(contentText); }; publicMethoads.footer = function (footerContent) { - $("#modal-footer-content").html(footerContent); + $("#basic-modal-view #modal-footer-content").html(footerContent); }; publicMethoads.footerButtons = function (buttonList) { @@ -37,7 +37,7 @@ var modalDialog = (function () { footerContent = footerContent + '
' + btn.text + '
'; } - $("#modal-footer-content").html(footerContent); + $("#basic-modal-view #modal-footer-content").html(footerContent); }; publicMethoads.show = function () { @@ -62,11 +62,21 @@ var modalDialog = (function () { publicMethoads.hide = function () { $("#basic-modal-view").addClass('hidden'); $("#basic-modal-view").modal('hide'); - $("#modal-title-text").html(""); - $("#modal-content-text").html(""); - $("#modal-footer-content").html(""); - $('body').removeClass('modal-open').css('padding-right', '0px'); $('.modal-backdrop').remove(); }; + + $("#basic-modal-view").on('hidden.bs.modal', function () { + $('#basic-modal-view .modal-dialog').html(''); + $('body').removeClass('modal-open').css('padding-right', '0px'); + }); + return publicMethoads; }(modalDialog)); \ No newline at end of file