From e112371d8ec8713f9ba2f2f7e731d1b048862512 Mon Sep 17 00:00:00 2001 From: Imesh Chandrasiri Date: Sat, 14 Jan 2017 23:51:07 +0530 Subject: [PATCH 1/2] Fix for multiple popup issue --- .../public/js/download.js | 2 +- .../type-view.hbs | 11 -------- .../public/js/type-view.js | 27 ++++++++++++++----- .../public/js/type-view.js | 2 +- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view/public/js/download.js b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view/public/js/download.js index c60366ed24..082cc15863 100644 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view/public/js/download.js +++ b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view/public/js/download.js @@ -67,6 +67,6 @@ function attachEvents() { function toggleEnrollment(){ $(modalPopupContent).html($("#qr-code-modal").html()); generateQRCode(modalPopupContent + " .qr-code"); - showPopup(); + modalDialog.show(); } } \ No newline at end of file diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view/type-view.hbs b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view/type-view.hbs index 1b9254a00f..904455e15b 100644 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view/type-view.hbs +++ b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view/type-view.hbs @@ -282,16 +282,5 @@ {{#zone "bottomJs"}} {{js "/js/download.js"}} - {{js "/js/jquery.validate.js"}} {{/zone}} \ No newline at end of file diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/js/type-view.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/js/type-view.js index 8011137ee1..122cbcb27f 100755 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/js/type-view.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/js/type-view.js @@ -73,10 +73,29 @@ function generateQRCode(qrCodeClass) { } function toggleEnrollment() { - console.log("something happenedfd!"); + modalDialog.header('' + + ''); + modalDialog.content('
' + + '
Please scan the following QR code using your Android device.
' + + '
' + + '

' + + '
Not having a QR code scanner in your device?

Try following link

' + + 'http://10.100.7.101:9763/android-web-agent/enrollment' + + '

on your device\'s Internet browser instead.
'); + modalDialog.footer('
' + + 'Ok
'); + $(".modal-content").html($("#qr-code-modal").html()); generateQRCode(".modal-content .qr-code"); - showPopup(); + modalDialog.show(); } var updateNotificationCountOnSuccess = function (data, textStatus, jqXHR) { @@ -345,10 +364,6 @@ $.fn.collapse_nav_sub = function () { } }; -$(".download-link").click(function(){ - toggleEnrollment(); -}); - $(document).ready(function () { $.sidebar_toggle(); if (typeof $.fn.collapse == 'function') { diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.type-view/public/js/type-view.js b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.type-view/public/js/type-view.js index 681a484f39..cd364ebbd0 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.type-view/public/js/type-view.js +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.type-view/public/js/type-view.js @@ -75,7 +75,7 @@ function generateQRCode(qrCodeClass) { function toggleEnrollment() { $(".modal-content").html($("#qr-code-modal").html()); generateQRCode(".modal-content .qr-code"); - showPopup(); + modalDialog.show(); } var updateNotificationCountOnSuccess = function (data, textStatus, jqXHR) { From 8eb95c3695118f8d3f8f566d5142b2f103222463 Mon Sep 17 00:00:00 2001 From: Imesh Chandrasiri Date: Sat, 14 Jan 2017 23:56:51 +0530 Subject: [PATCH 2/2] Fix for multiple popup issue --- .../public/js/type-view.js | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/js/type-view.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/js/type-view.js index 122cbcb27f..5f33fdb5b7 100755 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/js/type-view.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/js/type-view.js @@ -73,26 +73,6 @@ function generateQRCode(qrCodeClass) { } function toggleEnrollment() { - modalDialog.header('' + - ''); - modalDialog.content('
' + - '
Please scan the following QR code using your Android device.
' + - '
' + - '

' + - '
Not having a QR code scanner in your device?

Try following link

' + - 'http://10.100.7.101:9763/android-web-agent/enrollment' + - '

on your device\'s Internet browser instead.
'); - modalDialog.footer('
' + - 'Ok
'); - $(".modal-content").html($("#qr-code-modal").html()); generateQRCode(".modal-content .qr-code"); modalDialog.show();