Skip to content

Commit ce46d19

Browse files
committed
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
1 parent cd4bcbb commit ce46d19

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

client/commonFramework/display-test-results.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ window.common = (function({ $, common = { init: [] }}) {
22

33
common.displayTestResults = function displayTestResults(data = []) {
44
$('#testSuite').children().remove();
5+
$('#testSuite').fadeIn('slow');
56
data.forEach(({ err = false, text = '' }) => {
67
var iconClass = err ?
78
'"ion-close-circled big-error-icon"' :
@@ -20,7 +21,7 @@ window.common = (function({ $, common = { init: [] }}) {
2021
`)
2122
.appendTo($('#testSuite'));
2223
});
23-
24+
$('#scroll-locker').animate({ scrollTop: $(document).height() }, 'slow');
2425
return data;
2526
};
2627

client/commonFramework/end.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ $(document).ready(function() {
8989
common.submitBtn$
9090
)
9191
.flatMap(() => {
92+
$('#testSuite').fadeOut('slow');
9293
common.appendToOutputDisplay('\n// testing challenge...');
9394
return common.executeChallenge$()
9495
.map(({ tests, ...rest }) => {

0 commit comments

Comments
 (0)