speed up clicking on restaurant

This commit is contained in:
arzynik 2013-09-25 12:45:38 -07:00
parent 78a3a51924
commit 110fd3a9dd

View File

@ -127,13 +127,11 @@ NGApp.controller( 'RestaurantsCtrl', function ( $scope, $rootScope, $http, $loca
if (!restaurant.open()) {
$rootScope.$broadcast('restaurantClosedClick', restaurant);
} else {
var el = $($event.target).closest('.meal-item').find('.meal-item-content');
var el = $($event.target).parents('.meal-item').find('.meal-item-content');
var s = $(el).data('spinner');
if (!s) {
s = Ladda.create(el.get(0));
$(el).data('spinner', s);
if (s) {
s.start();
}
s.start();
// @todo: this is kind of redundundant
// make sure that the restaurant is actulay loaded first
@ -177,6 +175,14 @@ NGApp.controller( 'RestaurantsCtrl', function ( $scope, $rootScope, $http, $loca
$('.content').removeClass('short-meal-list');
}
$('.content').removeClass('smaller-width');
setTimeout(function() {
$('.meal-item-content').each(function() {
var s = Ladda.create(this);
$(this).data('spinner', s);
$scope.spin = s;
});
},1);
},
// Error