Sequential modx/goto_position hits correct multicourse URL
This commit is contained in:
@@ -3,6 +3,8 @@ class @Sequence
|
||||
@el = $(element).find('.sequence')
|
||||
@contents = @$('.seq_contents')
|
||||
@id = @el.data('id')
|
||||
@modx_url = @$('#course_modx_root').text()
|
||||
@modx_url = @modx_url.substr(1,@modx_url.length-2) # Remove enclosing quotes
|
||||
@initProgress()
|
||||
@bind()
|
||||
@render parseInt(@el.data('position'))
|
||||
@@ -76,7 +78,8 @@ class @Sequence
|
||||
if @position != new_position
|
||||
if @position != undefined
|
||||
@mark_visited @position
|
||||
$.postWithPrefix "/modx/#{@id}/goto_position", position: new_position
|
||||
modx_full_url = @modx_url + '/' + @id + '/goto_position'
|
||||
$.postWithPrefix modx_full_url, position: new_position
|
||||
|
||||
@mark_active new_position
|
||||
@$('#seq_content').html @contents.eq(new_position - 1).text()
|
||||
@@ -91,7 +94,7 @@ 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
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<div id="sequence_${element_id}" class="sequence" data-id="${item_id}" data-position="${position}" >
|
||||
<span style="display:none" id="course_modx_root">"/course/modx"</span>
|
||||
<nav aria-label="Section Navigation" class="sequence-nav">
|
||||
<ol id="sequence-list">
|
||||
% for idx, item in enumerate(items):
|
||||
|
||||
Reference in New Issue
Block a user