changed how google loc is used
This commit is contained in:
parent
4da727af3e
commit
bfda61c911
@ -18,5 +18,4 @@
|
||||
<link href="/assets/images/startup-640x920.png" media="(device-width: 320px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
|
||||
<link href="/assets/images/startup-640x1096.png" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
|
||||
|
||||
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
|
||||
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
|
||||
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
|
||||
@ -1218,6 +1218,8 @@ App.test = {
|
||||
},
|
||||
clearloc: function() {
|
||||
$.cookie('community', '', { expires: new Date(3000,01,01), path: '/'});
|
||||
$.cookie('location_lat', '', { expires: new Date(3000,01,01), path: '/'});
|
||||
$.cookie('location_lon', '', { expires: new Date(3000,01,01), path: '/'});
|
||||
location.href = '/';
|
||||
}
|
||||
};
|
||||
@ -1289,6 +1291,14 @@ App.loc = {
|
||||
}, complete, {maximumAge: 60000, timeout: 5000, enableHighAccuracy: true});
|
||||
}
|
||||
},
|
||||
preProcess: function() {
|
||||
if (google.loader.ClientLocation) {
|
||||
if (!$.cookie('location_lat')) {
|
||||
App.loc.lat = google.loader.ClientLocation.latitude;
|
||||
App.loc.lon = google.loader.ClientLocation.longitude;
|
||||
}
|
||||
}
|
||||
},
|
||||
process: function() {
|
||||
var did = false;
|
||||
if (App.config.user && !App.forceHome) {
|
||||
@ -1378,7 +1388,6 @@ App.loc = {
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1741,5 +1750,4 @@ $(function() {
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
google.load('maps', '3', {callback: App.loc.preProcess, other_params: 'sensor=false'});
|
||||
Loading…
x
Reference in New Issue
Block a user