Tracking time spent reading initial guides.

This commit is contained in:
Nick Winter 2014-07-13 16:07:15 -07:00
parent ebfb329da7
commit 6dc2a48b75
3 changed files with 12 additions and 2 deletions

View file

@ -9,6 +9,9 @@ module.exports =
'note-group-ended': 'note-group-ended':
{} # TODO schema {} # TODO schema
'modal-opened':
{} # TODO schema
'modal-closed': 'modal-closed':
{} # TODO schema {} # TODO schema

View file

@ -177,6 +177,7 @@ module.exports = class CocoView extends Backbone.View
$('#modal-wrapper .modal').modal(modalOptions).on 'hidden.bs.modal', @modalClosed $('#modal-wrapper .modal').modal(modalOptions).on 'hidden.bs.modal', @modalClosed
window.currentModal = modalView window.currentModal = modalView
@getRootView().stopListeningToShortcuts(true) @getRootView().stopListeningToShortcuts(true)
Backbone.Mediator.publish 'modal-opened', {}
modalClosed: => modalClosed: =>
visibleModal.willDisappear() if visibleModal visibleModal.willDisappear() if visibleModal
@ -190,7 +191,7 @@ module.exports = class CocoView extends Backbone.View
@openModalView(wm) @openModalView(wm)
else else
@getRootView().listenToShortcuts(true) @getRootView().listenToShortcuts(true)
Backbone.Mediator.publish 'modal-closed' Backbone.Mediator.publish 'modal-closed', {}
# Loading RootViews # Loading RootViews

View file

@ -138,7 +138,13 @@ module.exports = class PlayLevelView extends View
supermodel: @supermodel supermodel: @supermodel
firstOnly: true firstOnly: true
@openModalView(new DocsModal(options), 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 return true
getRenderData: -> getRenderData: ->