From 9d3949ea372b717f8bff7abbc06e701bd6ed97df Mon Sep 17 00:00:00 2001 From: kamidu Date: Wed, 5 Apr 2017 16:35:35 +0530 Subject: [PATCH 1/3] enabling loading for location refrsh --- .../device-view.hbs | 3 +++ .../public/js/load-map.js | 12 +++++++++--- 2 files changed, 12 insertions(+), 3 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.device-view/device-view.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.device-view/device-view.hbs index 88b5d3d06..189bcf087 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.device-view/device-view.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.device-view/device-view.hbs @@ -337,6 +337,9 @@ +
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.device-view/public/js/load-map.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.device-view/public/js/load-map.js index 10464f22c..85c516ecf 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.device-view/public/js/load-map.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.device-view/public/js/load-map.js @@ -32,6 +32,8 @@ function loadLeafletMap(refresh) { attribution = "© OpenStreetMap contributors"; if (refresh && !isAnalitics) { + console.log("holaaaa"); + $("#map-spinner").removeClass("hidden"); var applicationsList = $("#applications-list"); var deviceId = applicationsList.data("device-id"); var deviceType = applicationsList.data("device-type"); @@ -43,8 +45,10 @@ function loadLeafletMap(refresh) { data = JSON.parse(data); if (data.latitude && data.longitude) { map.removeLayer(marker); - marker = L.marker([6.912853, 79.855635], {"opacity": opacVal}).addTo(map).bindPopup("Your device is here"); - // marker = L.marker([data.latitude, data.longitude], {"opacity": opacVal}).addTo(map).bindPopup("Your device is here"); + // marker = L.marker([6.912853, 79.855635], {"opacity": opacVal}).addTo(map).bindPopup("Your device is here"); + marker = L.marker([data.latitude, data.longitude], {"opacity": opacVal}).addTo(map).bindPopup("Your device is here"); + map.panTo(new L.LatLng(data.latitude, data.longitude)); + // map.panTo(new L.LatLng(40.737, -73.923)); marker.on('mouseover', function (e) { this.openPopup(); }); @@ -52,14 +56,16 @@ function loadLeafletMap(refresh) { this.closePopup(); }); } + $("#map-spinner").addClass("hidden"); } else { - + $("#map-spinner").adddClass("hidden"); $("#device-location").hide(); $("#map-error").show(); } }, // error-callback function () { + $("#map-spinner").addClass("hidden"); $("#device-location").hide(); $("#map-error").show(); }); From eb7a83bcc8835e68a6504d86bdfd00e8fde32f7c Mon Sep 17 00:00:00 2001 From: kamidu Date: Wed, 5 Apr 2017 17:02:38 +0530 Subject: [PATCH 2/3] fixing location and operation loading ui issues --- .../operation-bar.hbs | 7 +++---- .../public/js/operation-bar.js | 10 ++++------ 2 files changed, 7 insertions(+), 10 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.operation-bar/operation-bar.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.operation-bar/operation-bar.hbs index b25fdf558..5e46d0009 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.operation-bar/operation-bar.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.operation-bar/operation-bar.hbs @@ -65,8 +65,6 @@ {{description}}
-
    Send - to Device     + class="btn btn-default">Send + to Device +
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.operation-bar/public/js/operation-bar.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.operation-bar/public/js/operation-bar.js index 4ab3a2271..8b621e931 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.operation-bar/public/js/operation-bar.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.operation-bar/public/js/operation-bar.js @@ -28,10 +28,8 @@ function operationSelect(selection) { } function submitForm(formId) { - $("#operation-form").addClass("hidden"); - $('[data-toggle="loading"]').removeClass("hidden"); - $('[data-toggle="loading"]').loading('show'); - + $("#btnSend").addClass("hidden"); + $("#lbl-execution").removeClass("hidden"); var form = $("#" + formId); var uri = form.attr("action"); var deviceId = form.data("device-id"); @@ -75,8 +73,8 @@ function submitForm(formId) { description.html(""); var resetLoader = function () { - $("#operation-form").removeClass("hidden"); - $('[data-toggle="loading"]').addClass("hidden"); + $("#btnSend").removeClass("hidden"); + $('#lbl-execution').addClass("hidden"); }; var successCallBack = function (response) { From dc0fda39252367e9dd7ace5574d6f7ffa25d1334 Mon Sep 17 00:00:00 2001 From: kamidu Date: Wed, 5 Apr 2017 17:04:28 +0530 Subject: [PATCH 3/3] fixing location and operation loading ui issues --- .../public/js/load-map.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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.device-view/public/js/load-map.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.device-view/public/js/load-map.js index 85c516ecf..49318af68 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.device-view/public/js/load-map.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.device-view/public/js/load-map.js @@ -32,7 +32,7 @@ function loadLeafletMap(refresh) { attribution = "© OpenStreetMap contributors"; if (refresh && !isAnalitics) { - console.log("holaaaa"); + $("#map-spinner").removeClass("hidden"); var applicationsList = $("#applications-list"); var deviceId = applicationsList.data("device-id");