Просмотр исходного кода

fix the popup alert when starting a new trial

Henry Oswald 11 лет назад
Родитель
Сommit
76be671e26
1 измененных файлов с 8 добавлено и 8 удалено
  1. 8 8
      services/web/public/coffee/main/account-upgrade.coffee

+ 8 - 8
services/web/public/coffee/main/account-upgrade.coffee

@@ -6,12 +6,12 @@ define [
 		$scope.buttonClass = "btn-primary"
 
 		$scope.startFreeTrial = (source, couponCode) ->
+			w = window.open()
 			sixpack.convert "track-changes-discount", ->
-
-				sixpack.participate 'free-trial-plan', ['student', 'collaborator'], (planName, rawResponse)->
-					ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source)
-					url = "/user/subscription/new?planCode=#{planName}_free_trial_7_days&ssp=#{planName == 'collaborator'}"
-					if couponCode?
-						url = "#{url}&cc=#{couponCode}"
-					window.open(url)
-					$scope.startedFreeTrial = true
+			sixpack.participate 'free-trial-plan', ['student', 'collaborator'], (planName, rawResponse)->
+				ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source)
+				url = "/user/subscription/new?planCode=#{planName}_free_trial_7_days&ssp=#{planName == 'collaborator'}"
+				if couponCode?
+					url = "#{url}&cc=#{couponCode}"
+				$scope.startedFreeTrial = true
+				w.location = url