فهرست منبع

Use angular `$http` service for references

Shane Kilkelly 9 سال پیش
والد
کامیت
f74da0e6cf
1فایلهای تغییر یافته به همراه8 افزوده شده و 12 حذف شده
  1. 8 12
      services/web/public/coffee/ide/references/ReferencesManager.coffee

+ 8 - 12
services/web/public/coffee/ide/references/ReferencesManager.coffee

@@ -44,22 +44,18 @@ define [
 				docIds: docIds
 				shouldBroadcast: shouldBroadcast
 				_csrf: window.csrfToken
-			$.post(
+			@ide.$http.post(
 				"/project/#{@$scope.project_id}/references/index",
-				opts,
-				(data) =>
-					# console.log ">> got keys ", data
-					@_storeReferencesKeys(data.keys)
-			)
+				opts
+			).then (response) =>
+				@_storeReferencesKeys(response.data.keys)
 
 		indexAllReferences: (shouldBroadcast) ->
 			opts =
 				shouldBroadcast: shouldBroadcast
 				_csrf: window.csrfToken
-			$.post(
+			@ide.$http.post(
 				"/project/#{@$scope.project_id}/references/indexAll",
-				opts,
-				(data) =>
-					# console.log ">> got keys ", data
-					@_storeReferencesKeys(data.keys)
-			)
+				opts
+			).then (response) =>
+				@_storeReferencesKeys(response.data.keys)