mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Tracking time spent reading initial guides.
This commit is contained in:
parent
ebfb329da7
commit
6dc2a48b75
3 changed files with 12 additions and 2 deletions
|
@ -9,6 +9,9 @@ module.exports =
|
|||
'note-group-ended':
|
||||
{} # TODO schema
|
||||
|
||||
'modal-opened':
|
||||
{} # TODO schema
|
||||
|
||||
'modal-closed':
|
||||
{} # TODO schema
|
||||
|
||||
|
|
|
@ -177,6 +177,7 @@ module.exports = class CocoView extends Backbone.View
|
|||
$('#modal-wrapper .modal').modal(modalOptions).on 'hidden.bs.modal', @modalClosed
|
||||
window.currentModal = modalView
|
||||
@getRootView().stopListeningToShortcuts(true)
|
||||
Backbone.Mediator.publish 'modal-opened', {}
|
||||
|
||||
modalClosed: =>
|
||||
visibleModal.willDisappear() if visibleModal
|
||||
|
@ -190,7 +191,7 @@ module.exports = class CocoView extends Backbone.View
|
|||
@openModalView(wm)
|
||||
else
|
||||
@getRootView().listenToShortcuts(true)
|
||||
Backbone.Mediator.publish 'modal-closed'
|
||||
Backbone.Mediator.publish 'modal-closed', {}
|
||||
|
||||
# Loading RootViews
|
||||
|
||||
|
|
|
@ -138,7 +138,13 @@ module.exports = class PlayLevelView extends View
|
|||
supermodel: @supermodel
|
||||
firstOnly: true
|
||||
@openModalView(new DocsModal(options), true)
|
||||
Backbone.Mediator.subscribeOnce 'modal-closed', @onLevelStarted, @
|
||||
onGuideOpened = ->
|
||||
@guideOpenTime = new Date()
|
||||
onGuideClosed = ->
|
||||
application.tracker?.trackTiming new Date() - @guideOpenTime, 'Intro Guide Time', @levelID, @levelID, 100
|
||||
@onLevelStarted()
|
||||
Backbone.Mediator.subscribeOnce 'modal-opened', onGuideOpened, @
|
||||
Backbone.Mediator.subscribeOnce 'modal-closed', onGuideClosed, @
|
||||
return true
|
||||
|
||||
getRenderData: ->
|
||||
|
|
Loading…
Reference in a new issue