fix for delivery destination not validating
This commit is contained in:
@@ -39,18 +39,19 @@ var loadCart = function() {
|
||||
_itemsForDisplay.fetch({
|
||||
success: function() {
|
||||
CartActions.dataLoaded();
|
||||
|
||||
_deliveryDestination.fetch({
|
||||
success: function() {
|
||||
validateDeliveryDestinationForm();
|
||||
fetchPlace();
|
||||
CartActions.dataLoaded();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//_deliveryDestination.fetch({
|
||||
//success: function() {
|
||||
//validateDeliveryDestinationForm();
|
||||
//fetchPlace();
|
||||
//CartActions.dataLoaded();
|
||||
//}
|
||||
//});
|
||||
_cartDataLoadCalled = true;
|
||||
};
|
||||
|
||||
@@ -78,7 +79,7 @@ var saveCartStateForItem = function(itemId) {
|
||||
};
|
||||
|
||||
/* need it for delete - will delete it later
|
||||
*/
|
||||
*/
|
||||
var takeItemOut = function(itemId) {
|
||||
|
||||
var state = states[itemId] || new ItemInCart({
|
||||
@@ -108,7 +109,7 @@ var setItemCount = function(itemId, count) {
|
||||
|
||||
var cnt = parseInt(count);
|
||||
|
||||
if(isNaN(cnt) || cnt <= 0) {
|
||||
if (isNaN(cnt) || cnt <= 0) {
|
||||
cnt = 1;
|
||||
}
|
||||
|
||||
@@ -195,7 +196,7 @@ var validateDeliveryDestinationForm = function() {
|
||||
}
|
||||
|
||||
var placeRegex = /^\s{0,1}\d{5}$/i;
|
||||
if (Validation.safeString(_deliveryDestination.get('place')).search(placeRegex) < 0){
|
||||
if (Validation.safeString(_deliveryDestination.get('place')).search(placeRegex) < 0) {
|
||||
_deliveryDestinationErrors['place'] = "Mjesto mora biti izabrano";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user