From f015682d5dff7fe46b7957747956a00a4b3e44b6 Mon Sep 17 00:00:00 2001 From: Matthew Piatetsky Date: Tue, 24 Oct 2017 14:21:07 -0400 Subject: [PATCH] Only convert price to local currency after document is ready --- .../static/course_experience/js/currency.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/openedx/features/course_experience/static/course_experience/js/currency.js b/openedx/features/course_experience/static/course_experience/js/currency.js index 2b0d863635..0367e61b31 100644 --- a/openedx/features/course_experience/static/course_experience/js/currency.js +++ b/openedx/features/course_experience/static/course_experience/js/currency.js @@ -66,9 +66,16 @@ export class Currency { // eslint-disable-line import/prefer-default-export this.setPrice(); } + getCountryCaller(position) { + const caller = function callerFunction() { + this.getCountry(position); + }.bind(this); + $(document).ready(caller); + } + getUserLocation() { // Get user location from browser - navigator.geolocation.getCurrentPosition(this.getCountry.bind(this)); + navigator.geolocation.getCurrentPosition(this.getCountryCaller.bind(this)); } constructor(skipInitialize) {