From 671abe1def42c9af3e35ee2dd673e5f67dc4eec0 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Thu, 12 Sep 2019 15:39:57 -0700 Subject: [PATCH] Fix the queued alerts not being displayed --- openlp/core/display/html/display.js | 4 ++++ tests/js/test_display.js | 1 + 2 files changed, 5 insertions(+) diff --git a/openlp/core/display/html/display.js b/openlp/core/display/html/display.js index 81b0a1e3c..d65945ae5 100644 --- a/openlp/core/display/html/display.js +++ b/openlp/core/display/html/display.js @@ -484,6 +484,7 @@ var Display = { alertBackground.classList.replace("hide", "show"); alertText.innerHTML = text; Display.setAlertLocation(settings.location); + Display._transitionState = TransitionState.EntranceTransition; /* Check if the alert is a queued alert */ if (Display._alertState !== AlertState.Displaying) { Display._alertState = AlertState.Displaying; @@ -512,6 +513,7 @@ var Display = { hideAlert: function () { var alertBackground = $('#alert-background')[0]; var alertText = $('#alert-text')[0]; + Display._transitionState = TransitionState.ExitTransition; alertText.classList.replace("show", "hide"); alertBackground.classList.replace("show", "hide"); alertText.style.animation = ""; @@ -575,7 +577,9 @@ var Display = { * Display the next alert in the queue */ showNextAlert: function () { + console.log("showNextAlert"); if (Display._alerts.length > 0) { + console.log("Showing next alert"); var alertObject = Display._alerts.shift(); Display._alertState = AlertState.DisplayingFromQueue; Display.showAlert(alertObject.text, alertObject.settings); diff --git a/tests/js/test_display.js b/tests/js/test_display.js index 054dd3916..fd051804e 100644 --- a/tests/js/test_display.js +++ b/tests/js/test_display.js @@ -281,6 +281,7 @@ describe("Display.hideAlert", function () { Display.hideAlert(); + expect(Display._transitionState).toEqual(TransitionState.ExitTransition); expect(alertBackground.classList.contains("hide")).toEqual(true); expect(alertBackground.classList.contains("show")).toEqual(false); expect(alertText.classList.contains("hide")).toEqual(true);