From 0ed66b6a9c488d22343c6d361b1023d712280f2d Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 30 Oct 2011 21:24:04 +0100 Subject: [PATCH] fixed alert position not being recalculated properly when changing options --- openlp/plugins/alerts/alertsplugin.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/openlp/plugins/alerts/alertsplugin.py b/openlp/plugins/alerts/alertsplugin.py index 213c6814f..493f08ba0 100644 --- a/openlp/plugins/alerts/alertsplugin.py +++ b/openlp/plugins/alerts/alertsplugin.py @@ -71,11 +71,24 @@ JAVASCRIPT = """ function update_css(align, font, size, color, bgcolor){ var text = document.getElementById('alert'); - text.style.verticalAlign = align; text.style.fontSize = size + "pt"; text.style.fontFamily = font; text.style.color = color; text.style.backgroundColor = bgcolor; + switch(align) + { + case 'top': + text.style.top = '0px'; + break; + case 'middle': + text.style.top = ((window.innerHeight - text.clientHeight) / 2) + + 'px'; + break; + case 'bottom': + text.style.top = (window.innerHeight - text.clientHeight) + + 'px'; + break; + } } """ CSS = """