From 5e46c4f346c79631e02f8e15c0a8b1a2369c6d44 Mon Sep 17 00:00:00 2001 From: Nico Opiyo Date: Tue, 12 Feb 2019 13:19:44 +0300 Subject: [PATCH] Fixed the location enumeration for the alerts --- openlp/core/display/html/display.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/openlp/core/display/html/display.js b/openlp/core/display/html/display.js index 226730a0d..9250f0312 100644 --- a/openlp/core/display/html/display.js +++ b/openlp/core/display/html/display.js @@ -38,9 +38,9 @@ var HorizontalAlign = { * Vertical alignment enumeration */ var VerticalAlign = { - Top: "0", - Middle: "1", - Bottom: "2" + Top: "top", + Middle: "middle", + Bottom: "bottom" }; /** @@ -481,19 +481,19 @@ var Display = { var alertBackground = $("#alert-background")[0]; switch (location) { - case VerticalAlign.Top: + case AlertLocation.Top: alertBackground.style.bottom = ''; alertBackground.style.top = '0px'; alertBackground.style.height = "25%"; alertBackground.style.transition = "2s linear"; break; - case VerticalAlign.Middle: + case AlertLocation.Middle: alertBackground.style.top = ((window.innerHeight - alertBackground.clientHeight) / 2) + 'px'; alertBackground.style.height = "25%"; alertBackground.classList.add("middle-entrance-animation"); Display._animationState = AnimationState.FadeInAnimation; break; - case VerticalAlign.Bottom: + case AlertLocation.Bottom: default: alertBackground.style.top = ''; alertBackground.style.bottom = '0px'; @@ -514,11 +514,11 @@ var Display = { var alertBackground = $("#alert-background")[0]; - if (location == VerticalAlign.Top || location == VerticalAlign.Bottom) { + if (location == AlertLocation.Top || location == AlertLocation.Bottom) { alertBackground.style.height = "0%"; alertBackground.style.transition = '2s linear'; } - else if (location == VerticalAlign.Middle) { + else if (location == AlertLocation.Middle) { alertBackground.classList.add("middle-exit-animation"); alertBackground.style.height = "0%"; Display._animationState = AnimationState.FadeOutAnimation;