Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
problem-builder
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
OpenEdx
problem-builder
Commits
cffa4537
Commit
cffa4537
authored
Nov 11, 2015
by
Tim Krones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Scroll to top when navigating to next step or loading page.
parent
06e41fcd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
problem_builder/public/js/mentoring_with_steps.js
+17
-2
No files found.
problem_builder/public/js/mentoring_with_steps.js
View file @
cffa4537
...
...
@@ -168,11 +168,14 @@ function MentoringWithStepsBlock(runtime, element) {
if
(
step
.
hasQuestion
())
{
reviewButtonDOM
.
attr
(
'disabled'
,
'disabled'
);
}
else
{
reviewButtonDOM
.
removeAttr
(
'disabled'
)
reviewButtonDOM
.
removeAttr
(
'disabled'
)
;
}
reviewButtonDOM
.
show
();
}
}
// Scroll to top of this block
scrollIntoView
();
}
function
showReviewStep
()
{
...
...
@@ -189,7 +192,7 @@ function MentoringWithStepsBlock(runtime, element) {
}
function
hideReviewStep
()
{
reviewStepDOM
.
hide
()
reviewStepDOM
.
hide
()
;
}
function
getStepToReview
(
event
)
{
...
...
@@ -225,6 +228,9 @@ function MentoringWithStepsBlock(runtime, element) {
reviewLinkDOM
.
show
();
getResults
();
// Scroll to top of this block
scrollIntoView
();
}
function
showAttempts
()
{
...
...
@@ -323,6 +329,9 @@ function MentoringWithStepsBlock(runtime, element) {
nextDOM
.
off
();
nextDOM
.
on
(
'click'
,
reviewNextStep
);
reviewLinkDOM
.
hide
();
// Scroll to top of this block
scrollIntoView
();
}
function
reviewNextStep
()
{
...
...
@@ -363,6 +372,12 @@ function MentoringWithStepsBlock(runtime, element) {
}
}
function
scrollIntoView
()
{
var
rootBlock
=
$
(
element
),
rootBlockOffset
=
rootBlock
.
offset
().
top
;
$
(
'html, body'
).
animate
({
scrollTop
:
rootBlockOffset
},
500
);
}
function
initClickHandlers
()
{
$
(
document
).
on
(
"click"
,
function
(
event
,
ui
)
{
var
target
=
$
(
event
.
target
);
...
...
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