From 3c8b0c290160d11f75b01047e672ed3dbbbf12b8 Mon Sep 17 00:00:00 2001 From: thlo Date: Sat, 14 Sep 2013 18:16:29 +0200 Subject: Additions to previous commit. --- smarttv-client/Javascript/Display.js | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) (limited to 'smarttv-client/Javascript/Display.js') diff --git a/smarttv-client/Javascript/Display.js b/smarttv-client/Javascript/Display.js index 62e3412..b1f7d37 100755 --- a/smarttv-client/Javascript/Display.js +++ b/smarttv-client/Javascript/Display.js @@ -47,6 +47,11 @@ Display.init = function() this.popupOlHandler.init(Display.handlerShowPopup, Display.handlerHidePopup); this.infoOlHandler.init(Display.handlerShowInfo, Display.handlerHideInfo); this.infoOlHandler.olDelay = Config.infoTimeout; + + // Different popup behavior during config phase; + this.popupOlHandler.olDelay = 30*1000; + $("#popup").css("height", "300px"); + // end if (!this.statusDiv) { success = false; @@ -277,7 +282,7 @@ Display.tuneLeftSide = function() { res.w3 = "5%"; switch (Main.state) { case Main.eLIVE: - res.w1 = "5%"; + res.w1 = "7%"; res.w2 = "25%"; res.w3 = "65%"; break; @@ -901,9 +906,26 @@ Display.handlerHideInfo = function() { * Popup handlers */ Display.showPopup = function(text) { - var oldHTML = document.getElementById("popup").innerHTML; - Display.putInnerHTML(document.getElementById("popup"), oldHTML + "
" + text); +// var oldHTML = document.getElementById("popup").innerHTML; +// Display.putInnerHTML(document.getElementById("popup"), oldHTML + "
" + text); + + if (text == "") + this.popupOlHandler.show(); + + var elm = $("

", {text: text}); + $("#popup").append(elm); this.popupOlHandler.show(); + + Display.scrollPopup (); +}; + +Display.scrollPopup = function () { + var t = $('#popup').children().last().position().top; + var h = $('#popup').children().last().outerHeight(); + if ((t + h) > $("#popup").height()) { + $("#popup").animate ({scrollTop: $("#popup").scrollTop() + t + h - $("#popup").height()}, 200); + } + }; Display.handlerShowPopup = function() { @@ -912,6 +934,10 @@ Display.handlerShowPopup = function() { }; Display.handlerHidePopup = function() { + $("#popup").css("height", "100px"); + + $('#popup').children().each(function() { $(this).remove(); }); + document.getElementById("popup").style.display="none"; Display.putInnerHTML(document.getElementById("popup"), ""); }; -- cgit v1.2.3