mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Fixing a Javascript bug
This commit is contained in:
@@ -4,7 +4,8 @@ angular.module("Checkout").controller "CheckoutCtrl", ($scope, $rootScope) ->
|
||||
$scope.payment_method = -1
|
||||
|
||||
$scope.shippingMethodChanged = ->
|
||||
$scope.require_ship_address = $("#order_shipping_method_" + $scope.shipping_method).attr("data-require-ship-address")
|
||||
console.log $("#order_shipping_method_id_" + $scope.shipping_method).attr("data-require-ship-address")
|
||||
$scope.require_ship_address = $("#order_shipping_method_id_" + $scope.shipping_method).attr("data-require-ship-address")
|
||||
|
||||
$scope.purchase = (event)->
|
||||
event.preventDefault()
|
||||
|
||||
@@ -36,7 +36,9 @@
|
||||
.large-6.columns.right
|
||||
= ba.text_field :zipcode
|
||||
|
||||
{{ require_ship_address }}
|
||||
%fieldset#shipping
|
||||
|
||||
%legend Shipping
|
||||
- checked_id = @order.shipping_method_id || current_distributor.shipping_methods.first.andand.id
|
||||
- for ship_method, i in current_distributor.shipping_methods.uniq
|
||||
@@ -44,7 +46,7 @@
|
||||
.large-12.columns
|
||||
= f.radio_button :shipping_method_id, ship_method.id,
|
||||
text: ship_method.name,
|
||||
"ng-init" => "shipping_method = #{checked_id}",
|
||||
"ng-init" => "shipping_method = #{checked_id}; shippingMethodChanged()",
|
||||
"ng-model" => "shipping_method",
|
||||
"ng-change" => "shippingMethodChanged()",
|
||||
"data-require-ship-address" => ship_method.require_ship_address
|
||||
|
||||
Reference in New Issue
Block a user