From 1c87b9219860ecb0cc5546381a3bef4282f408de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 2 Dec 2015 11:13:44 +0100 Subject: [PATCH] misc: add uniform error handling for geolocation errors (#9170) --- wcs/qommon/static/js/qommon.geolocation.js | 2 ++ wcs/qommon/static/js/qommon.map.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/wcs/qommon/static/js/qommon.geolocation.js b/wcs/qommon/static/js/qommon.geolocation.js index 2423060..a2cf2b3 100644 --- a/wcs/qommon/static/js/qommon.geolocation.js +++ b/wcs/qommon/static/js/qommon.geolocation.js @@ -180,6 +180,8 @@ function geoloc_prefill(element_type, element_value) }, function (error_msg) { $('div[data-geolocation] label').removeClass('activity'); + $($('div[data-geolocation] label')[0]).after( + '' + error_msg.message + ''); }); } } diff --git a/wcs/qommon/static/js/qommon.map.js b/wcs/qommon/static/js/qommon.map.js index ab0676c..ba70f3c 100644 --- a/wcs/qommon/static/js/qommon.map.js +++ b/wcs/qommon/static/js/qommon.map.js @@ -59,7 +59,7 @@ $(window).on('load', function() { }); map.on('locationerror', function(e) { $map_widget.parent().parent().find('label').removeClass('activity'); - $map_widget.parent().parent().find('label').after('' + e.message + ''); + $map_widget.parent().parent().find('label').after('' + e.message + ''); }); $map_widget.parent().parent().find('label').addClass('activity') map.locate({timeout: 10000, maximumAge: 60000}); -- 2.6.2