Skip to content

Commit

Permalink
After error div fades away, old errors can reshow
Browse files Browse the repository at this point in the history
  • Loading branch information
Strilanc committed Apr 30, 2016
1 parent 9f2a0ff commit 23221de
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/fallback.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]';
Expand Down

0 comments on commit 23221de

Please sign in to comment.