forked from GNUsocial/gnu-social
Added errorCallback() to geoCurrentPosition() i.e., if user doesn't
grant permission, removes the Geo processing and (if any) existing geo location data from notice form.
This commit is contained in:
parent
d1998adb13
commit
fe8927a42c
17
js/util.js
17
js/util.js
@ -493,7 +493,8 @@ var SN = { // StatusNet
|
||||
return false;
|
||||
});
|
||||
|
||||
navigator.geolocation.getCurrentPosition(function(position) {
|
||||
navigator.geolocation.getCurrentPosition(
|
||||
function(position) {
|
||||
$('#'+SN.C.S.NoticeLat).val(position.coords.latitude);
|
||||
$('#'+SN.C.S.NoticeLon).val(position.coords.longitude);
|
||||
|
||||
@ -530,7 +531,19 @@ var SN = { // StatusNet
|
||||
return false;
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
function(error) {
|
||||
if (error.PERMISSION_DENIED == 1) {
|
||||
$('label[for='+SN.C.S.NoticeDataGeo+']').removeClass('checked');
|
||||
NDGS.hide();
|
||||
$('#'+SN.C.S.NoticeLat).val('');
|
||||
$('#'+SN.C.S.NoticeLon).val('');
|
||||
$('#'+SN.C.S.NoticeLocationNs).val('');
|
||||
$('#'+SN.C.S.NoticeLocationId).val('');
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
else {
|
||||
$('label[for='+SN.C.S.NoticeDataGeo+']').removeClass('checked');
|
||||
|
Loading…
Reference in New Issue
Block a user