fire ga events on renames/deletes

This commit is contained in:
Henry Oswald 2014-03-20 08:52:04 +00:00
parent 4f577b5467
commit 7310f94511
3 changed files with 10 additions and 0 deletions

View file

@ -111,10 +111,12 @@ define [
text: "Rename" text: "Rename"
onClick: () => onClick: () =>
@startRename() @startRename()
ga('send', 'event', 'editor-interaction', 'renameEntity', {menu:"DropdownMenu", entityDropdown:"entityView"})
}, { }, {
text: "Delete" text: "Delete"
onClick: () => onClick: () =>
@manager.confirmDelete(@model) @manager.confirmDelete(@model)
ga('send', 'event', 'editor-interaction', 'deleteEntity', {menu:"DropdownMenu", entityDropdown:"entityView"})
}] }]
_initializeDrag: () -> _initializeDrag: () ->

View file

@ -155,6 +155,8 @@ define [
entity_id = @getSelectedEntityId() entity_id = @getSelectedEntityId()
return if !entity_id? return if !entity_id?
@views[entity_id]?.startRename() @views[entity_id]?.startRename()
ga('send', 'event', 'editor-interaction', 'renameEntity', {menu:"topMenu"})
renameEntity: (entity, name) -> renameEntity: (entity, name) ->
@ide.socket.emit 'renameEntity', entity.id, entity.get("type"), name @ide.socket.emit 'renameEntity', entity.id, entity.get("type"), name
@ -247,6 +249,7 @@ define [
# DELETING # DELETING
confirmDelete: (entity) -> confirmDelete: (entity) ->
ga('send', 'event', 'editor-interaction', 'deleteEntity', {menu:"topMenu"})
Modal.createModal Modal.createModal
title: "Confirm Deletion" title: "Confirm Deletion"
message: "Are you sure you want to delete <strong>#{entity.get("name")}</strong>?" message: "Are you sure you want to delete <strong>#{entity.get("name")}</strong>?"

View file

@ -11,18 +11,23 @@ define [
"click .js-new-file" : (e) -> "click .js-new-file" : (e) ->
e.preventDefault() e.preventDefault()
@manager.showNewDocModal() @manager.showNewDocModal()
ga('send', 'event', 'editor-interaction', 'newFile', {menu:"DropdownMenu", entityDropdown:"folder"})
"click .js-new-folder" : (e) -> "click .js-new-folder" : (e) ->
e.preventDefault() e.preventDefault()
@manager.showNewFolderModal() @manager.showNewFolderModal()
ga('send', 'event', 'editor-interaction', 'newFolder', {menu:"DropdownMenu", entityDropdown:"folder"})
"click .js-upload-file" : (e) -> "click .js-upload-file" : (e) ->
e.preventDefault() e.preventDefault()
@manager.showUploadFileModal() @manager.showUploadFileModal()
ga('send', 'event', 'editor-interaction', 'uploadFile', {menu:"DropdownMenu", entityDropdown:"folder"})
"click .js-delete-btn" : (e) -> "click .js-delete-btn" : (e) ->
e.preventDefault() e.preventDefault()
@manager.confirmDeleteOfSelectedEntity() @manager.confirmDeleteOfSelectedEntity()
ga('send', 'event', 'editor-interaction', 'deleteEntity', {menu:"DropdownMenu", entityDropdown:"folder"})
"click .js-rename-btn" : (e) -> "click .js-rename-btn" : (e) ->
e.preventDefault() e.preventDefault()
@manager.renameSelected() @manager.renameSelected()
ga('send', 'event', 'editor-interaction', 'renameEntity', {menu:"DropdownMenu", entityDropdown:"folder"})
) )
render: () -> render: () ->