Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
bb55a763
Commit
bb55a763
authored
Aug 29, 2012
by
kimth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow courseware to navigate to specific tabs of a sequence
parent
e62f8d75
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
8 deletions
+20
-8
common/lib/xmodule/xmodule/js/src/sequence/display.coffee
+20
-8
No files found.
common/lib/xmodule/xmodule/js/src/sequence/display.coffee
View file @
bb55a763
...
...
@@ -2,6 +2,7 @@ class @Sequence
constructor
:
(
element
)
->
@
el
=
$
(
element
).
find
(
'.sequence'
)
@
contents
=
@
$
(
'.seq_contents'
)
@
num_contents
=
@
contents
.
length
@
id
=
@
el
.
data
(
'id'
)
@
modx_url
=
@
el
.
data
(
'course_modx_root'
)
@
initProgress
()
...
...
@@ -90,18 +91,29 @@ class @Sequence
@
toggleArrows
()
@
hookUpProgressEvent
()
sequence_links
=
@
$
(
'#seq_content a.seqnav'
)
sequence_links
.
click
@
goto
goto
:
(
event
)
=>
event
.
preventDefault
()
new_position
=
$
(
event
.
target
).
data
(
'element'
)
Logger
.
log
"seq_goto"
,
old
:
@
position
,
new
:
new_position
,
id
:
@
id
# Links from within the coureware uses <a class='seqnav' href="n">...</a>
if
$
(
event
.
target
).
hasClass
'seqnav'
new_position
=
$
(
event
.
target
).
attr
(
'href'
)
else
new_position
=
$
(
event
.
target
).
data
(
'element'
)
if
(
1
<=
new_position
)
and
(
new_position
<=
@
num_contents
)
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
# 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
@
render
new_position
else
alert
'Sequence error! Cannot navigate to tab '
+
new_position
+
'in the current SequenceModule. Please contact the course staff.'
next
:
(
event
)
=>
event
.
preventDefault
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment