Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
bb55a763
Commit
bb55a763
authored
12 years ago
by
kimth
Browse files
Options
Downloads
Patches
Plain Diff
Allow courseware to navigate to specific tabs of a sequence
parent
e62f8d75
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/lib/xmodule/xmodule/js/src/sequence/display.coffee
+20
-8
20 additions, 8 deletions
common/lib/xmodule/xmodule/js/src/sequence/display.coffee
with
20 additions
and
8 deletions
common/lib/xmodule/xmodule/js/src/sequence/display.coffee
+
20
−
8
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
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment