Animate #testSuite to focus user on errors
- As soon as the user clicks the button we hide('slow') the div #testSuite - Then on displayTestResults we show it. Use fadeOut/fadeIn instead of hide/show Scroll the div #scroll-locker to the bottom - Fix for some challenges with long contents on div #scroll-locker Fix Err: Strings must use singlequote quotes
This commit is contained in:
@ -2,6 +2,7 @@ window.common = (function({ $, common = { init: [] }}) {
|
|||||||
|
|
||||||
common.displayTestResults = function displayTestResults(data = []) {
|
common.displayTestResults = function displayTestResults(data = []) {
|
||||||
$('#testSuite').children().remove();
|
$('#testSuite').children().remove();
|
||||||
|
$('#testSuite').fadeIn('slow');
|
||||||
data.forEach(({ err = false, text = '' }) => {
|
data.forEach(({ err = false, text = '' }) => {
|
||||||
var iconClass = err ?
|
var iconClass = err ?
|
||||||
'"ion-close-circled big-error-icon"' :
|
'"ion-close-circled big-error-icon"' :
|
||||||
@ -20,7 +21,7 @@ window.common = (function({ $, common = { init: [] }}) {
|
|||||||
`)
|
`)
|
||||||
.appendTo($('#testSuite'));
|
.appendTo($('#testSuite'));
|
||||||
});
|
});
|
||||||
|
$('#scroll-locker').animate({ scrollTop: $(document).height() }, 'slow');
|
||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -89,6 +89,7 @@ $(document).ready(function() {
|
|||||||
common.submitBtn$
|
common.submitBtn$
|
||||||
)
|
)
|
||||||
.flatMap(() => {
|
.flatMap(() => {
|
||||||
|
$('#testSuite').fadeOut('slow');
|
||||||
common.appendToOutputDisplay('\n// testing challenge...');
|
common.appendToOutputDisplay('\n// testing challenge...');
|
||||||
return common.executeChallenge$()
|
return common.executeChallenge$()
|
||||||
.map(({ tests, ...rest }) => {
|
.map(({ tests, ...rest }) => {
|
||||||
|
Reference in New Issue
Block a user