Apply Tomas patch

This commit is contained in:
Raoul Snyman 2019-09-05 21:31:51 -07:00
parent b42034de47
commit 9c078cce04

View File

@ -417,15 +417,16 @@ var Display = {
} }
else { else {
if (this._alertState === AlertState.Displaying) { if (this._alertState === AlertState.Displaying) {
Display.addAlertToQueue(text, alert_settings); Display.addAlertToQueue(text, alertSettings);
}
} }
else
{
var settings = JSON.parse(alertSettings); var settings = JSON.parse(alertSettings);
this._alertSettings = settings; this._alertSettings = settings;
Display.setAlertText(text, settings.fontColor, settings.fontFace, settings.fontSize); Display.setAlertText(text, settings.fontColor, settings.fontFace, settings.fontSize);
Display.setAlertLocation(settings.location); Display.setAlertLocation(settings.location);
/* Check if the alert is a queued alert */ /* Check if the alert is a queued alert */
if (Display._alertState !== AlertState.DisplayingFromQueue) { if (Display._alertState !== AlertState.Displaying) {
Display._alertState = AlertState.Displaying; Display._alertState = AlertState.Displaying;
} }
@ -433,6 +434,8 @@ var Display = {
alertText.addEventListener('animationend', Display.alertAnimationEndEvent, false); alertText.addEventListener('animationend', Display.alertAnimationEndEvent, false);
Display.showAlertBackground(settings.backgroundColor); Display.showAlertBackground(settings.backgroundColor);
}
}
}, },
/** /**
* Add an alert to the alert queue * Add an alert to the alert queue
@ -460,7 +463,7 @@ var Display = {
*/ */
alertTransitionEndEvent: function (e) { alertTransitionEndEvent: function (e) {
e.stopPropagation(); e.stopPropagation();
console.debug("Transition end event reached"); console.debug("Transition end event reached: " + Display._transitionState);
if (Display._transitionState === TransitionState.EntranceTransition) { if (Display._transitionState === TransitionState.EntranceTransition) {
Display._transitionState = TransitionState.NoTransition; Display._transitionState = TransitionState.NoTransition;
Display.showAlertText(Display._alertSettings); Display.showAlertText(Display._alertSettings);
@ -469,10 +472,7 @@ var Display = {
Display._transitionState = TransitionState.NoTransition; Display._transitionState = TransitionState.NoTransition;
Display.removeAlertLocation(Display._alertSettings.location); Display.removeAlertLocation(Display._alertSettings.location);
Display.clearAlertSettings(); Display.clearAlertSettings();
setTimeout(function () {
Display.showNextAlert(); Display.showNextAlert();
}, AlertDelay.OnePointFiveSeconds);
} }
}, },
/** /**