-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
After error div fades away, old errors can reshow
- Loading branch information
Showing
1 changed file
with
12 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,23 @@ import describe from "src/base/Describe.js" | |
|
||
let _alreadySeen = []; | ||
let showErrorDiv = (subject, body) => { | ||
document.getElementById('errorDiv').style.backgroundColor = '#FFA'; | ||
document.getElementById('errorDiv').style.opacity = 1.0; | ||
document.getElementById('errorDiv').style.display = 'block'; | ||
let errDivStyle = document.getElementById('errorDiv').style; | ||
if (errDivStyle.display !== 'block') { | ||
// Faded away. We can re-show messages now. | ||
_alreadySeen = []; | ||
} | ||
|
||
// Error just happened, so this should be showing and highlighted. | ||
errDivStyle.backgroundColor = '#FFA'; | ||
errDivStyle.opacity = 1.0; | ||
errDivStyle.display = 'block'; | ||
|
||
if (_alreadySeen.indexOf(body) !== -1) { | ||
return; | ||
} | ||
_alreadySeen.push(body); | ||
|
||
// Set shown error details. | ||
document.getElementById('errorMessageDiv').innerText = subject; | ||
document.getElementById('errorDescDiv').innerText = body; | ||
document.getElementById('error-mailto-anchor').innerText = 'Email the issue to [email protected]'; | ||
|