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:
Helder
2016-06-15 05:47:00 -04:00
parent cd4bcbb5da
commit ce46d1906b
2 changed files with 3 additions and 1 deletions

View File

@ -2,6 +2,7 @@ window.common = (function({ $, common = { init: [] }}) {
common.displayTestResults = function displayTestResults(data = []) {
$('#testSuite').children().remove();
$('#testSuite').fadeIn('slow');
data.forEach(({ err = false, text = '' }) => {
var iconClass = err ?
'"ion-close-circled big-error-icon"' :
@ -20,7 +21,7 @@ window.common = (function({ $, common = { init: [] }}) {
`)
.appendTo($('#testSuite'));
});
$('#scroll-locker').animate({ scrollTop: $(document).height() }, 'slow');
return data;
};

View File

@ -89,6 +89,7 @@ $(document).ready(function() {
common.submitBtn$
)
.flatMap(() => {
$('#testSuite').fadeOut('slow');
common.appendToOutputDisplay('\n// testing challenge...');
return common.executeChallenge$()
.map(({ tests, ...rest }) => {