mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-06 11:02:00 +00:00
Bind to an object to avoid writing in different .
This commit is contained in:
parent
f4aab93dfa
commit
c82ab65077
2 changed files with 14 additions and 14 deletions
|
@ -60,19 +60,19 @@ block content
|
|||
.row
|
||||
.col-md-6
|
||||
label.radio-inline
|
||||
input.paymentTypeOption(type="radio",value="credit_card", ng-model="paymentMethod")
|
||||
input.paymentTypeOption(type="radio",value="credit_card", ng-model="paymentMethod.value")
|
||||
i.fa.fa-cc-mastercard.fa-3x
|
||||
span
|
||||
i.fa.fa-cc-visa.fa-3x
|
||||
.col-md-6
|
||||
label.radio-inline
|
||||
input.paymentTypeOption(type="radio", value="paypal", ng-model="paymentMethod")
|
||||
input.paymentTypeOption(type="radio", value="paypal", ng-model="paymentMethod.value")
|
||||
i.fa.fa-cc-paypal.fa-3x
|
||||
|
||||
.alert.alert-warning.small(ng-show="genericError")
|
||||
strong {{genericError}}
|
||||
|
||||
span(ng-hide="paymentMethod == 'paypal'")
|
||||
span(ng-hide="paymentMethod.value == 'paypal'")
|
||||
.row
|
||||
.col-md-12
|
||||
.form-group
|
||||
|
@ -184,7 +184,7 @@ block content
|
|||
a.payment-method-toggle-switch(
|
||||
href
|
||||
ng-click="setPaymentMethod('credit_card');"
|
||||
ng-class="paymentMethod === 'credit_card' ? 'payment-method-toggle-switch-selected' : ''"
|
||||
ng-class="paymentMethod.value === 'credit_card' ? 'payment-method-toggle-switch-selected' : ''"
|
||||
)
|
||||
i.fa.fa-cc-mastercard.fa-2x
|
||||
span
|
||||
|
@ -194,14 +194,14 @@ block content
|
|||
a.payment-method-toggle-switch(
|
||||
href
|
||||
ng-click="setPaymentMethod('paypal');"
|
||||
ng-class="paymentMethod === 'paypal' ? 'payment-method-toggle-switch-selected' : ''"
|
||||
ng-class="paymentMethod.value === 'paypal' ? 'payment-method-toggle-switch-selected' : ''"
|
||||
)
|
||||
i.fa.fa-cc-paypal.fa-2x
|
||||
|
||||
.alert.alert-warning.small(ng-show="genericError")
|
||||
strong {{genericError}}
|
||||
|
||||
div(ng-if="paymentMethod === 'credit_card'")
|
||||
div(ng-if="paymentMethod.value === 'credit_card'")
|
||||
.row
|
||||
.col-xs-6
|
||||
.form-group(ng-class="validation.errorFields.first_name || inputHasError(simpleCCForm.firstName) ? 'has-error' : ''")
|
||||
|
@ -310,7 +310,7 @@ block content
|
|||
ng-model="data.coupon"
|
||||
)
|
||||
|
||||
p(ng-if="paymentMethod === 'paypal'") #{translate("paypal_upgrade")}
|
||||
p(ng-if="paymentMethod.value === 'paypal'") #{translate("paypal_upgrade")}
|
||||
|
||||
div.price-breakdown(ng-if="price.next.tax !== '0.00'")
|
||||
hr.thin
|
||||
|
@ -330,7 +330,7 @@ block content
|
|||
span(ng-show="processing")
|
||||
i.fa.fa-spinner.fa-spin
|
||||
|
|
||||
| {{ paymentMethod === 'credit_card' ? '#{translate("upgrade_cc_btn")}' : '#{translate("upgrade_paypal_btn")}' }}
|
||||
| {{ paymentMethod.value === 'credit_card' ? '#{translate("upgrade_cc_btn")}' : '#{translate("upgrade_paypal_btn")}' }}
|
||||
|
||||
|
||||
.col-md-3.col-md-pull-4
|
||||
|
|
|
@ -14,7 +14,8 @@ define [
|
|||
|
||||
event_tracking.sendMB "subscription-form", { plan : window.plan_code }
|
||||
|
||||
$scope.paymentMethod = "credit_card"
|
||||
$scope.paymentMethod =
|
||||
value: "credit_card"
|
||||
|
||||
$scope.data =
|
||||
number: ""
|
||||
|
@ -107,7 +108,7 @@ define [
|
|||
return (formItem.$touched && formItem.$invalid)
|
||||
|
||||
$scope.isFormValid = isFormValid = (form) ->
|
||||
if $scope.paymentMethod == 'paypal'
|
||||
if $scope.paymentMethod.value == 'paypal'
|
||||
return $scope.data.country != ""
|
||||
else
|
||||
return (form.$valid and
|
||||
|
@ -116,11 +117,10 @@ define [
|
|||
$scope.validation.correctCvv)
|
||||
|
||||
$scope.updateCountry = ->
|
||||
console.log $scope.data.country
|
||||
pricing.address({country:$scope.data.country}).done()
|
||||
|
||||
$scope.setPaymentMethod = setPaymentMethod = (method) ->
|
||||
$scope.paymentMethod = method;
|
||||
$scope.paymentMethod.value = method;
|
||||
$scope.validation.errorFields = {}
|
||||
$scope.genericError = ""
|
||||
|
||||
|
@ -142,7 +142,7 @@ define [
|
|||
currencyCode:pricing.items.currency
|
||||
plan_code:pricing.items.plan.code
|
||||
coupon_code:pricing.items?.coupon?.code || ""
|
||||
isPaypal: $scope.paymentMethod == 'paypal'
|
||||
isPaypal: $scope.paymentMethod.value == 'paypal'
|
||||
address:
|
||||
address1: $scope.data.address1
|
||||
address2: $scope.data.address2
|
||||
|
@ -170,7 +170,7 @@ define [
|
|||
|
||||
$scope.submit = ->
|
||||
$scope.processing = true
|
||||
if $scope.paymentMethod == 'paypal'
|
||||
if $scope.paymentMethod.value == 'paypal'
|
||||
opts = { description: $scope.planName }
|
||||
recurly.paypal opts, completeSubscription
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue