-
-
Save wesleyvicthor/666ecbea52bc75eec40a to your computer and use it in GitHub Desktop.
issues with namespace in firefox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).on('user.location', getUserLocation); | |
$(document).on('user.location.check', checkLocation); | |
$(document).trigger('user.location.check', checkLocation); | |
function checkLocation() | |
{ | |
$.get(userLocationUrl, function(result) { | |
if (!$.isEmptyObject(result)) { | |
$(document).off('user.location.check'); | |
return; | |
} | |
$(document).trigger('user.location'); | |
}, 'json'); | |
} | |
function getUserLocation() | |
{ | |
Location.get(function(position, error) { | |
if (error) { | |
return error.message; | |
} | |
var params = { | |
uf: position.uf, | |
city: position.city, | |
lat: position.coords.latitude, | |
lng: position.coords.longitude | |
}; | |
$.get(userLocationUrl, params, function(result) { | |
if (!$.isEmptyObject(result)) { | |
window.location.reload(); | |
} | |
}, 'json'); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment