Position change in sequence kills polling thread, rather than new Problem creation

This commit is contained in:
kimth
2012-08-10 13:10:53 -04:00
parent 64eba4332c
commit f6b2cabd83
2 changed files with 7 additions and 6 deletions

View File

@@ -4,12 +4,6 @@ class @Problem
@id = @el.data('problem-id')
@element_id = @el.attr('id')
@url = @el.data('url')
# Destroy any existing polling threads on Problem change
if window.queuePollerID
window.clearTimeout(window.queuePollerID)
delete window.queuePollerID
@render()
$: (selector) ->

View File

@@ -91,6 +91,13 @@ class @Sequence
event.preventDefault()
new_position = $(event.target).data('element')
Logger.log "seq_goto", old: @position, new: new_position, id: @id
# On Sequence chage, destroy any existing polling thread
# for queued submissions, see ../capa/display.coffee
if window.queuePollerID
window.clearTimeout(window.queuePollerID)
delete window.queuePollerID
@render new_position
next: (event) =>