summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/ui/site/EditSubscriptionModal.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/javascripts/ui/site/EditSubscriptionModal.js')
-rw-r--r--public/assets/javascripts/ui/site/EditSubscriptionModal.js24
1 files changed, 14 insertions, 10 deletions
diff --git a/public/assets/javascripts/ui/site/EditSubscriptionModal.js b/public/assets/javascripts/ui/site/EditSubscriptionModal.js
index 539a8ae..fe93499 100644
--- a/public/assets/javascripts/ui/site/EditSubscriptionModal.js
+++ b/public/assets/javascripts/ui/site/EditSubscriptionModal.js
@@ -31,46 +31,50 @@ var EditSubscriptionModal = ModalView.extend({
},
resetMode: function(e){
- e.preventDefault()
+ e && e.preventDefault()
this.$paidPlan.removeClass("editLayouts editPlan")
this.reset()
},
layoutsMode: function(e){
- e.preventDefault()
+ e && e.preventDefault()
this.$paidPlan.addClass("editLayouts")
this.tempSubscriber = defaults({}, this.subscriber)
this.$basicLayoutInput.val( this.subscriber.basic_layouts )
this.$proLayoutInput.val( this.subscriber.pro_layouts )
+ this.$basicLayoutRow.show()
+ this.$proLayoutRow.toggle(this.subscriber.plan_name == "pro")
},
updateQuantity: function(e){
- e.preventDefault()
- this.tempSubscriber.basic_layouts = this.$proLayoutInput.int()
- this.tempSubscriber.pro_layouts = this.$basicLayoutInput.int()
+ e && e.preventDefault()
+ this.tempSubscriber.basic_layouts = this.$basicLayoutInput.int()
+ this.tempSubscriber.pro_layouts = this.$proLayoutInput.int()
var plan = this.getPlan( this.tempSubscriber.plan_type )
this.displayTotals(this.tempSubscriber, plan)
+ this.$basicLayoutRow.show()
+ this.$proLayoutRow.toggle(plan.name == "pro")
},
saveQuantity: function(e){
- e.preventDefault()
+ e && e.preventDefault()
// blabla.. save
this.subscriber = this.tempSubscriber
this.resetMode()
},
planMode: function(e){
- e.preventDefault()
+ e && e.preventDefault()
this.$paidPlan.addClass("editPlan")
this.$planRadio.val( this.subscriber.plan_type )
this.tempSubscriber = defaults({}, this.subscriber)
},
updatePlan: function(e){
- e.preventDefault()
+ e && e.preventDefault()
var plan = this.getPlan( this.$("[name=planRadio]").val() )
this.displayTotals(this.tempSubscriber, plan)
},
savePlan: function(e){
- e.preventDefault()
+ e && e.preventDefault()
this.subscriber.plan_type = this.$("[name=planRadio]").val()
this.subscriber = this.tempSubscriber
this.resetMode()
@@ -178,7 +182,7 @@ var EditSubscriptionModal = ModalView.extend({
this.$freePlan.hide()
this.$paidPlan.show()
- this.reset()
+ this.resetMode()
this.__super__.show.call(this)
},