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
83d12cd7
Commit
83d12cd7
authored
Aug 06, 2013
by
Miles Steele
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add scroll to top on vertical view change
parent
a7568fbf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
18 deletions
+22
-18
common/lib/xmodule/xmodule/js/src/sequence/display.coffee
+22
-18
No files found.
common/lib/xmodule/xmodule/js/src/sequence/display.coffee
View file @
83d12cd7
...
@@ -132,34 +132,38 @@ class @Sequence
...
@@ -132,34 +132,38 @@ class @Sequence
else
else
alert
'Sequence error! Cannot navigate to tab '
+
new_position
+
'in the current SequenceModule. Please contact the course staff.'
alert
'Sequence error! Cannot navigate to tab '
+
new_position
+
'in the current SequenceModule. Please contact the course staff.'
next
:
(
event
)
=>
next
:
(
event
)
=>
@
_change_sequential
'seq_next'
,
event
event
.
preventDefault
()
previous
:
(
event
)
=>
@
_change_sequential
'seq_prev'
,
event
new_position
=
@
position
+
1
Logger
.
log
"seq_next"
,
old
:
@
position
,
new
:
new_position
,
id
:
@
id
analytics
.
pageview
@
id
# navigation using the next arrow
analytics
.
track
"Accessed Next Sequential"
,
sequence_id
:
@
id
current_sequential
:
@
position
target_sequential
:
new_position
@
render
new_position
# `direction` can be 'seq_prev' or 'seq_next'
_change_sequential
:
(
direction
,
event
)
=>
# silently abort if direction is invalid.
return
unless
direction
in
[
'seq_prev'
,
'seq_next'
]
previous
:
(
event
)
=>
event
.
preventDefault
()
event
.
preventDefault
()
new_position
=
@
position
-
1
offset
=
Logger
.
log
"seq_prev"
,
old
:
@
position
,
new
:
new_position
,
id
:
@
id
seq_next
:
1
seq_prev
:
-
1
new_position
=
@
position
+
offset
[
direction
]
Logger
.
log
direction
,
old
:
@
position
new
:
new_position
id
:
@
id
analytics
.
pageview
@
id
analytics
.
pageview
@
id
# navigation using the previous arrow
# navigation using the next or previous arrow button.
analytics
.
track
"Accessed Previous Sequential"
,
tracking_messages
=
seq_prev
:
"Accessed Previous Sequential"
seq_next
:
"Accessed Next Sequential"
analytics
.
track
tracking_messages
[
direction
],
sequence_id
:
@
id
sequence_id
:
@
id
current_sequential
:
@
position
current_sequential
:
@
position
target_sequential
:
new_position
target_sequential
:
new_position
# If the bottom nav is used, scroll to the top of the page on change.
if
$
(
event
.
target
).
closest
(
'nav[class="sequence-bottom"]'
).
length
>
0
$
.
scrollTo
0
,
150
@
render
new_position
@
render
new_position
link_for
:
(
position
)
->
link_for
:
(
position
)
->
...
...
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