mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-13 22:49:51 -04:00
Add show subscribe modal events
This commit is contained in:
parent
bae90024b5
commit
4ff6e95f62
3 changed files with 10 additions and 1 deletions
|
@ -29,6 +29,7 @@ module.exports = class PaymentsView extends RootView
|
|||
|
||||
onClickStartSubscription: (e) ->
|
||||
@openModalView new SubscribeModal()
|
||||
window.tracker?.trackEvent 'Show subscription modal', category: 'Subscription', label: 'payments view'
|
||||
|
||||
onSubscribed: ->
|
||||
document.location.reload()
|
||||
|
|
|
@ -120,7 +120,11 @@ module.exports = class WorldMapView extends RootView
|
|||
@preloadTopHeroes() unless me.get('heroConfig')?.thangType
|
||||
if @requiresSubscription
|
||||
modal = if me.get('anonymous') then AuthModal else SubscribeModal
|
||||
_.delay (=> @openModalView? new modal() unless window.currentModal), 2000
|
||||
_.delay =>
|
||||
@openModalView? new modal() unless window.currentModal
|
||||
if modal is SubscribeModal
|
||||
window.tracker?.trackEvent 'Show subscription modal', category: 'Subscription', label: 'world map loadded'
|
||||
, 2000
|
||||
|
||||
onSubscribed: ->
|
||||
@requiresSubscription = false
|
||||
|
@ -208,6 +212,8 @@ module.exports = class WorldMapView extends RootView
|
|||
if @requiresSubscription and not @levelStatusMap[level.id] and not level.adventurer
|
||||
modal = if me.get('anonymous') then AuthModal else SubscribeModal
|
||||
@openModalView new modal()
|
||||
if modal is SubscribeModal
|
||||
window.tracker?.trackEvent 'Show subscription modal', category: 'Subscription', label: 'map level clicked'
|
||||
else if $(e.target).attr('disabled')
|
||||
Backbone.Mediator.publish 'router:navigate', route: '/contribute/adventurer'
|
||||
return
|
||||
|
|
|
@ -112,6 +112,8 @@ module.exports = class LevelLoadingView extends CocoView
|
|||
onClickStartSubscription: (e) ->
|
||||
modal = if me.get('anonymous') then AuthModal else SubscribeModal
|
||||
@openModalView new modal()
|
||||
if modal is SubscribeModal
|
||||
window.tracker?.trackEvent 'Show subscription modal', category: 'Subscription', label: 'level loading'
|
||||
|
||||
onSubscribed: ->
|
||||
document.location.reload()
|
||||
|
|
Loading…
Reference in a new issue