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

Read project id from the global window var

Alberto Fernández Capel 8 лет назад
Родитель
Сommit
8a1523cc03

+ 1 - 2
services/web/public/coffee/ide/editor/directives/aceEditor.coffee

@@ -301,8 +301,7 @@ define [
 				onChange = () ->
 				onChange = () ->
 					updateCount++
 					updateCount++
 
 
-					projectId = _.last(location.pathname.split("/"))
-					event_tracking.editingSessionHeartbeat(projectId)
+					event_tracking.editingSessionHeartbeat()
 
 
 					if updateCount == 100
 					if updateCount == 100
 						event_tracking.send 'editor-interaction', 'multi-doc-update'
 						event_tracking.send 'editor-interaction', 'multi-doc-update'

+ 2 - 2
services/web/public/coffee/main/event.coffee

@@ -35,9 +35,9 @@ define [
 			send: (category, action, label, value)->
 			send: (category, action, label, value)->
 				ga('send', 'event', category, action, label, value)
 				ga('send', 'event', category, action, label, value)
 
 
-			editingSessionHeartbeat: _.throttle( (projectId, segmentation = {}) ->
+			editingSessionHeartbeat: _.throttle( (segmentation = {}) ->
 				$http({
 				$http({
-					url: "/editingSession/#{projectId}",
+					url: "/editingSession/#{window.project_id}",
 					method: "PUT",
 					method: "PUT",
 					data: segmentation,
 					data: segmentation,
 					headers: {
 					headers: {