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
88e355f7
Commit
88e355f7
authored
Mar 28, 2017
by
Jeremy Bowman
Committed by
GitHub
Mar 28, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14757 from edx/jmbowman/PLAT-1198
PLAT-1198 Reduce risk of losing navigation events
parents
9d5b6d15
d1f25612
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
10 deletions
+23
-10
common/lib/xmodule/xmodule/js/src/sequence/display.js
+14
-6
common/test/acceptance/pages/lms/courseware.py
+8
-2
common/test/acceptance/tests/lms/test_lms_courseware.py
+1
-2
No files found.
common/lib/xmodule/xmodule/js/src/sequence/display.js
View file @
88e355f7
...
@@ -339,7 +339,7 @@
...
@@ -339,7 +339,7 @@
// `direction` can be 'previous' or 'next'
// `direction` can be 'previous' or 'next'
Sequence
.
prototype
.
_change_sequential
=
function
(
direction
,
event
)
{
Sequence
.
prototype
.
_change_sequential
=
function
(
direction
,
event
)
{
var
analyticsEventName
,
isBottomNav
,
newPosition
,
offset
,
widgetPlacement
;
var
analyticsEventName
,
isBottomNav
,
newPosition
,
offset
,
targetUrl
,
widgetPlacement
;
// silently abort if direction is invalid.
// silently abort if direction is invalid.
if
(
direction
!==
'previous'
&&
direction
!==
'next'
)
{
if
(
direction
!==
'previous'
&&
direction
!==
'next'
)
{
...
@@ -355,19 +355,27 @@
...
@@ -355,19 +355,27 @@
widgetPlacement
=
'top'
;
widgetPlacement
=
'top'
;
}
}
if
((
direction
===
'next'
)
&&
(
this
.
position
>=
this
.
contents
.
length
))
{
targetUrl
=
this
.
nextUrl
;
}
else
if
((
direction
===
'previous'
)
&&
(
this
.
position
===
1
))
{
targetUrl
=
this
.
prevUrl
;
}
// Formerly known as seq_next and seq_prev
// Formerly known as seq_next and seq_prev
Logger
.
log
(
analyticsEventName
,
{
Logger
.
log
(
analyticsEventName
,
{
id
:
this
.
id
,
id
:
this
.
id
,
current_tab
:
this
.
position
,
current_tab
:
this
.
position
,
tab_count
:
this
.
num_contents
,
tab_count
:
this
.
num_contents
,
widget_placement
:
widgetPlacement
widget_placement
:
widgetPlacement
}).
always
(
function
()
{
if
(
targetUrl
)
{
// Wait to load the new page until we've attempted to log the event
window
.
location
.
href
=
targetUrl
;
}
});
});
if
((
direction
===
'next'
)
&&
(
this
.
position
>=
this
.
contents
.
length
))
{
// If we're staying on the page, no need to wait for the event logging to finish
window
.
location
.
href
=
this
.
nextUrl
;
if
(
!
targetUrl
)
{
}
else
if
((
direction
===
'previous'
)
&&
(
this
.
position
===
1
))
{
window
.
location
.
href
=
this
.
prevUrl
;
}
else
{
// If the bottom nav is used, scroll to the top of the page on change.
// If the bottom nav is used, scroll to the top of the page on change.
if
(
isBottomNav
)
{
if
(
isBottomNav
)
{
$
.
scrollTo
(
0
,
150
);
$
.
scrollTo
(
0
,
150
);
...
...
common/test/acceptance/pages/lms/courseware.py
View file @
88e355f7
...
@@ -131,7 +131,10 @@ class CoursewarePage(CoursePage):
...
@@ -131,7 +131,10 @@ class CoursewarePage(CoursePage):
against the case where the page is still being loaded.
against the case where the page is still being loaded.
"""
"""
active_tab
=
self
.
_active_sequence_tab
active_tab
=
self
.
_active_sequence_tab
return
active_tab
and
int
(
active_tab
.
attrs
(
'data-element'
)[
0
])
==
sequential_position
try
:
return
active_tab
and
int
(
active_tab
.
attrs
(
'data-element'
)[
0
])
==
sequential_position
except
IndexError
:
return
False
sequential_position_css
=
'#sequence-list #tab_{0}'
.
format
(
sequential_position
-
1
)
sequential_position_css
=
'#sequence-list #tab_{0}'
.
format
(
sequential_position
-
1
)
self
.
q
(
css
=
sequential_position_css
)
.
first
.
click
()
self
.
q
(
css
=
sequential_position_css
)
.
first
.
click
()
...
@@ -181,7 +184,10 @@ class CoursewarePage(CoursePage):
...
@@ -181,7 +184,10 @@ class CoursewarePage(CoursePage):
against the case where the page is still being loaded.
against the case where the page is still being loaded.
"""
"""
active_tab
=
self
.
_active_sequence_tab
active_tab
=
self
.
_active_sequence_tab
return
active_tab
and
previous_tab_id
!=
active_tab
.
attrs
(
'data-id'
)[
0
]
try
:
return
active_tab
and
previous_tab_id
!=
active_tab
.
attrs
(
'data-id'
)[
0
]
except
IndexError
:
return
False
self
.
q
(
self
.
q
(
css
=
'.{} > .sequence-nav-button.{}'
.
format
(
top_or_bottom_class
,
next_or_previous_class
)
css
=
'.{} > .sequence-nav-button.{}'
.
format
(
top_or_bottom_class
,
next_or_previous_class
)
...
...
common/test/acceptance/tests/lms/test_lms_courseware.py
View file @
88e355f7
...
@@ -5,7 +5,6 @@ End-to-end tests for the LMS.
...
@@ -5,7 +5,6 @@ End-to-end tests for the LMS.
import
json
import
json
from
datetime
import
datetime
,
timedelta
from
datetime
import
datetime
,
timedelta
from
unittest
import
skip
import
ddt
import
ddt
from
flaky
import
flaky
from
flaky
import
flaky
...
@@ -441,7 +440,7 @@ class CoursewareMultipleVerticalsTest(CoursewareMultipleVerticalsTestBase):
...
@@ -441,7 +440,7 @@ class CoursewareMultipleVerticalsTest(CoursewareMultipleVerticalsTestBase):
Test courseware with multiple verticals
Test courseware with multiple verticals
"""
"""
@
skip
(
'Disable temporarily to get course bookmarks out'
)
@
flaky
# PLAT-1198; should be fixed, but verify that failures stop before removing
def
test_navigation_buttons
(
self
):
def
test_navigation_buttons
(
self
):
self
.
courseware_page
.
visit
()
self
.
courseware_page
.
visit
()
...
...
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