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.policy-edit/public/js/android-policy-edit.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.policy-edit/public/js/android-policy-edit.js index f8e7c65fa..c34646467 100644 --- 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.policy-edit/public/js/android-policy-edit.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.policy-edit/public/js/android-policy-edit.js @@ -174,14 +174,14 @@ var ovpnConfigUploaded = function () { }; var certConfigUploaded = function (val) { - var certFileInput = document.getElementById("cert-file-field"); - if ('files' in certFileInput) { - if (certFileInput.files.length === 1) { + var certFileInput = $(val); + if (certFileInput[0].files) { + if (certFileInput[0].files.length === 1) { var reader = new FileReader(); - reader.onload = function (progressEvent) { + reader.onload = function(progressEvent){ var txt = ""; var lines = this.result.split('\n'); - for (var line = 0; line < lines.length; line++) { + for(var line = 0; line < lines.length; line++){ console.log(lines[line]); if (lines[line].charAt(0) !== '#') { txt += lines[line] + '\n'; @@ -191,7 +191,7 @@ var certConfigUploaded = function (val) { //console.log(document.getElementById ("cert-config").value); $(val).next().val(txt); }; - reader.readAsText(certFileInput.files[0]); + reader.readAsText(certFileInput[0].files[0]); } } }; 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.policy-edit/public/templates/android-policy-edit.hbs 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.policy-edit/public/templates/android-policy-edit.hbs index 28dac3063..62c5b887c 100644 --- 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.policy-edit/public/templates/android-policy-edit.hbs +++ 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.policy-edit/public/templates/android-policy-edit.hbs @@ -78,9 +78,9 @@ - + - Secure Certificates + Certificates Install @@ -1431,7 +1431,7 @@ data-operation-code="INSTALL_CERT">
- + - Secure Certificate + Certificate Install @@ -2327,7 +2327,7 @@ data-operation-code="INSTALL_CERT">
- + - Secure Certificate + Certificate Install @@ -2346,7 +2346,7 @@ data-operation-code="INSTALL_CERT">