Skip to content

Commit 3b61206

Browse files
committed
renaming some variables for better readability
1 parent f3fc455 commit 3b61206

File tree

3 files changed

+55
-55
lines changed

3 files changed

+55
-55
lines changed

dist/breinify-api.js

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15330,13 +15330,13 @@ dependencyScope.jQuery = $;;
1533015330
});
1533115331

1533215332
var _privates = {
15333-
foundGeoLocation: false,
15333+
resolvedGeoLocation: false,
1533415334
geoLocation: null,
1533515335

1533615336
resolveGeoLocation: function (callback) {
1533715337
var _self = this;
1533815338

15339-
if (_self.foundGeoLocation) {
15339+
if (_self.resolvedGeoLocation) {
1534015340
return _self.geoLocation;
1534115341
}
1534215342

@@ -15346,12 +15346,12 @@ dependencyScope.jQuery = $;;
1534615346

1534715347
// make sure we have a geolocation implementation
1534815348
if (typeof geo !== 'object') {
15349-
_self.foundGeoLocation = true;
15349+
_self.resolvedGeoLocation = true;
1535015350
callback(null);
1535115351

1535215352
return;
1535315353
} else if (typeof permissions !== 'object') {
15354-
_self.foundGeoLocation = true;
15354+
_self.resolvedGeoLocation = true;
1535515355
callback(null);
1535615356

1535715357
return;
@@ -15362,35 +15362,35 @@ dependencyScope.jQuery = $;;
1536215362

1536315363
// check if the permission is already granted
1536415364
permissions.query({name: 'geolocation'}).then(function (permission) {
15365-
if (permission.state === 'granted') {
15366-
15367-
geo.getCurrentPosition(
15368-
function (position) {
15369-
_self.foundGeoLocation = true;
15370-
_self.geoLocation = {
15371-
'accuracy': position.coords.accuracy,
15372-
'latitude': position.coords.latitude,
15373-
'longitude': position.coords.longitude,
15374-
'speed': position.coords.speed
15375-
};
15376-
15377-
callback(_self.geoLocation);
15378-
}, function () {
15379-
_self.foundGeoLocation = true;
15380-
callback(null)
15381-
}, {
15382-
'timeout': 150
15383-
});
15384-
} else {
15385-
_self.foundGeoLocation = true;
15365+
if (permission.state !== 'granted') {
15366+
_self.resolvedGeoLocation = true;
1538615367
callback(null);
15368+
15369+
return;
1538715370
}
15371+
15372+
geo.getCurrentPosition(function (position) {
15373+
_self.resolvedGeoLocation = true;
15374+
_self.geoLocation = {
15375+
'accuracy': position.coords.accuracy,
15376+
'latitude': position.coords.latitude,
15377+
'longitude': position.coords.longitude,
15378+
'speed': position.coords.speed
15379+
};
15380+
15381+
callback(_self.geoLocation);
15382+
}, function () {
15383+
_self.resolvedGeoLocation = true;
15384+
callback(null)
15385+
}, {
15386+
'timeout': 150
15387+
});
1538815388
}).catch(e => {
15389-
_self.foundGeoLocation = true;
15389+
_self.resolvedGeoLocation = true;
1539015390
callback(null);
1539115391
});
1539215392
} catch (e) {
15393-
_self.foundGeoLocation = true;
15393+
_self.resolvedGeoLocation = true;
1539415394
callback(null);
1539515395
}
1539615396
}

dist/breinify-api.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/BreinifyUser.js

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@
9595
});
9696

9797
var _privates = {
98-
foundGeoLocation: false,
98+
resolvedGeoLocation: false,
9999
geoLocation: null,
100100

101101
resolveGeoLocation: function (callback) {
102102
var _self = this;
103103

104-
if (_self.foundGeoLocation) {
104+
if (_self.resolvedGeoLocation) {
105105
return _self.geoLocation;
106106
}
107107

@@ -111,12 +111,12 @@
111111

112112
// make sure we have a geolocation implementation
113113
if (typeof geo !== 'object') {
114-
_self.foundGeoLocation = true;
114+
_self.resolvedGeoLocation = true;
115115
callback(null);
116116

117117
return;
118118
} else if (typeof permissions !== 'object') {
119-
_self.foundGeoLocation = true;
119+
_self.resolvedGeoLocation = true;
120120
callback(null);
121121

122122
return;
@@ -127,35 +127,35 @@
127127

128128
// check if the permission is already granted
129129
permissions.query({name: 'geolocation'}).then(function (permission) {
130-
if (permission.state === 'granted') {
131-
132-
geo.getCurrentPosition(
133-
function (position) {
134-
_self.foundGeoLocation = true;
135-
_self.geoLocation = {
136-
'accuracy': position.coords.accuracy,
137-
'latitude': position.coords.latitude,
138-
'longitude': position.coords.longitude,
139-
'speed': position.coords.speed
140-
};
141-
142-
callback(_self.geoLocation);
143-
}, function () {
144-
_self.foundGeoLocation = true;
145-
callback(null)
146-
}, {
147-
'timeout': 150
148-
});
149-
} else {
150-
_self.foundGeoLocation = true;
130+
if (permission.state !== 'granted') {
131+
_self.resolvedGeoLocation = true;
151132
callback(null);
133+
134+
return;
152135
}
136+
137+
geo.getCurrentPosition(function (position) {
138+
_self.resolvedGeoLocation = true;
139+
_self.geoLocation = {
140+
'accuracy': position.coords.accuracy,
141+
'latitude': position.coords.latitude,
142+
'longitude': position.coords.longitude,
143+
'speed': position.coords.speed
144+
};
145+
146+
callback(_self.geoLocation);
147+
}, function () {
148+
_self.resolvedGeoLocation = true;
149+
callback(null)
150+
}, {
151+
'timeout': 150
152+
});
153153
}).catch(e => {
154-
_self.foundGeoLocation = true;
154+
_self.resolvedGeoLocation = true;
155155
callback(null);
156156
});
157157
} catch (e) {
158-
_self.foundGeoLocation = true;
158+
_self.resolvedGeoLocation = true;
159159
callback(null);
160160
}
161161
}

0 commit comments

Comments
 (0)