Advertisement
Guest User

Untitled

a guest
May 24th, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. _asyncPcrCheck: (collection) ->
  2. requestBatch = []
  3. @presentationCollection = collection
  4. context = this
  5. presentation_ids = _.map App.data.my_presentations.models, (model) -> model.id
  6.  
  7. _.each presentation_ids, (presentation_id) =>
  8. requestBatch.push(presentation_id)
  9.  
  10. if requestBatch.length > 4 or requestBatch.length == presentation_ids.length
  11. $.ajax
  12. url: "presentations/moments/presentations_content_refresh"
  13. conxtext: context
  14. data:
  15. presentation_ids: requestBatch
  16. success: context.presentationUpdateCallback
  17.  
  18. presentation_ids = _.difference(presentation_ids, requestBatch)
  19. requestBatch = []
  20.  
  21. return
  22.  
  23. _presentationUpdateCallback: (data) ->
  24. console.log data
  25. console.log this
  26. console.log @presentationCollection
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement