Make sequence module use ajax_url properly

This commit is contained in:
Calen Pennington
2013-10-22 10:31:17 -04:00
parent ae32abfd62
commit ac8eeb681f
3 changed files with 4 additions and 3 deletions

View File

@@ -4,7 +4,7 @@ class @Sequence
@contents = @$('.seq_contents')
@num_contents = @contents.length
@id = @el.data('id')
@modx_url = @el.data('course_modx_root')
@ajaxUrl = @el.data('ajax-url')
@initProgress()
@bind()
@render parseInt(@el.data('position'))
@@ -84,7 +84,7 @@ class @Sequence
if @position != new_position
if @position != undefined
@mark_visited @position
modx_full_url = @modx_url + '/' + @id + '/goto_position'
modx_full_url = '#{@ajaxUrl}/goto_position'
$.postWithPrefix modx_full_url, position: new_position
# On Sequence change, fire custom event "sequence:change" on element.

View File

@@ -98,6 +98,7 @@ class SequenceModule(SequenceFields, XModule):
'item_id': self.id,
'position': self.position,
'tag': self.location.category,
'ajax_url': self.system.ajax_url,
}
fragment.add_content(self.system.render_template('seq_module.html', params))