-
Notifications
You must be signed in to change notification settings - Fork 60
Stopping video playback for hidden steps #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,8 @@ function MentoringStepBlock(runtime, element) { | |
|
|
||
| var submitXHR, resultsXHR, | ||
| message = $(element).find('.sb-step-message'); | ||
|
|
||
| var childManager = new ProblemBuilderStepUtil.ChildManager(element, runtime); | ||
|
|
||
| function callIfExists(obj, fn) { | ||
| if (typeof obj !== 'undefined' && typeof obj[fn] == 'function') { | ||
|
|
@@ -13,13 +15,6 @@ function MentoringStepBlock(runtime, element) { | |
| } | ||
| } | ||
|
|
||
| function updateVideo(video) { | ||
| video.resizer.align(); | ||
| } | ||
|
|
||
| function updatePlot(plot) { | ||
| plot.update(); | ||
| } | ||
|
|
||
| return { | ||
|
|
||
|
|
@@ -56,7 +51,7 @@ function MentoringStepBlock(runtime, element) { | |
| }, | ||
|
|
||
| showFeedback: function(response) { | ||
| // Called when user has just submitted an answer or is reviewing their answer durign extended feedback. | ||
| // Called when user has just submitted an answer or is reviewing their answer during extended feedback. | ||
| if (message.length) { | ||
| message.fadeIn(); | ||
| $(document).click(function() { | ||
|
|
@@ -110,20 +105,21 @@ function MentoringStepBlock(runtime, element) { | |
| return $('.sb-step', element).data('has-question'); | ||
| }, | ||
|
|
||
| updateChildren: function() { | ||
| children.forEach(function(child) { | ||
| var type = $(child.element).data('block-type'); | ||
| switch (type) { | ||
| case 'video': | ||
| updateVideo(child); | ||
| break; | ||
| case 'sb-plot': | ||
| updatePlot(child); | ||
| break; | ||
| } | ||
| }); | ||
| } | ||
| /** | ||
| * Shows a step, updating all children. | ||
| */ | ||
| showStep: function () { | ||
| $(element).show(); | ||
| childManager.show(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jbzdak Based on the way
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a |
||
| }, | ||
|
|
||
| /** | ||
| * Hides a step, updating all children. | ||
| */ | ||
| hideStep: function () { | ||
| $(element).hide(); | ||
| childManager.hide(); | ||
| } | ||
| }; | ||
|
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the changes in this file are leftover from last PR, I left it in on the basis that this makes the code cleaner. But they can be safely removed.