added location detection to location page
This commit is contained in:
parent
0bb40daee5
commit
628c7f2805
@ -19,7 +19,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="location-detect">
|
||||
<div class="location-detect-icon"></div>
|
||||
<div class="location-detect-icon" ng-click="locEat()"></div>
|
||||
<div class="location-detect-loader"></div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@ -181,6 +181,10 @@ NGApp.controller( 'location', function ($scope, $http, $location, RestaurantsSer
|
||||
$scope.recommend.greetings = false;
|
||||
$scope.locationError = true;
|
||||
});
|
||||
|
||||
var proceed = function() {
|
||||
App.go('/' + App.restaurants.permalink);
|
||||
};
|
||||
|
||||
// lets eat button
|
||||
$scope.letsEat = function() {
|
||||
@ -194,9 +198,7 @@ NGApp.controller( 'location', function ($scope, $http, $location, RestaurantsSer
|
||||
// Verify if the address has restaurant
|
||||
$scope.restaurantsService.list(
|
||||
// Success
|
||||
function(){
|
||||
$location.path( '/' + App.restaurants.permalink );
|
||||
},
|
||||
proceed,
|
||||
// Error
|
||||
function(){
|
||||
$scope.$broadcast( 'locationError' );
|
||||
@ -209,6 +211,13 @@ NGApp.controller( 'location', function ($scope, $http, $location, RestaurantsSer
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$scope.locEat = function() {
|
||||
$scope.location.getLocationByBrowser(function(loc) {
|
||||
$scope.location.position.addLocation(loc);
|
||||
proceed();
|
||||
});
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user