X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=js%2Fscreen.js;h=a850104252716f3832bb072401f75996f7c49d97;hb=f19a294d54f38faaeab0027ecb5d85388243b924;hp=2e5ff37bcacdc2e4808d1e19a7c55f66e0e80fc0;hpb=f53425414d1861f105a3063cdbb4bf96cdc755a2;p=Rakka.git diff --git a/js/screen.js b/js/screen.js index 2e5ff37..a850104 100644 --- a/js/screen.js +++ b/js/screen.js @@ -1,11 +1,11 @@ (function () { - + var switchedArea = null; Rakka.switchScreen = function () { if (switchedArea == null) { switchedArea = $.DIV({}); - + $("div.sideBar div.outline").hide(); $("p.redirection").hide(); @@ -15,30 +15,57 @@ .hide() .end() .append(switchedArea); + + $("body").append( + $.DIV({className: "left sideBarMask"})); + + var btnClose + = $.INPUT({type : "button", + className: "closeButton", + value : "Close"}); + $("body").append( + $.DIV({className: "right sideBarMask"}, + $.DIV({className: "content"}, + btnClose))); + + $(btnClose).click(function () { + Rakka.restoreScreen(); + }); } else { $(switchedArea).empty(); } - + return $(switchedArea); }; Rakka.restoreScreen = function () { - if (switchedArea == null) { - throw new Error("Rakka.restoreScreen(): not switched"); - } + if (switchedArea != null) { + $("div.sideBar div.outline").show(); - $("div.sideBar div.outline").show(); + $("p.redirection").show(); - $("p.redirection").show(); + $(switchedArea).remove(); + switchedArea = null; - $(switchedArea).remove(); - switchedArea = null; + $("div.sideBarMask").remove(); - $("div.body").children().show(); + $("div.body").children().show(); + } return null; }; + Rakka.getSwitchedScreen = function () { + return switchedArea; + }; + + Rakka.scrollToTopLeft = function () { + $("div.center").each(function () { + this.scrollTop = 0; + this.scrollLeft = 0; + }); + }; + var waitingMessageBoard = null; Rakka.displayWaitingMessage = function (msg) { @@ -47,7 +74,7 @@ waitingMessageBoard = $.P({className: "waitingMessageBoard"}, $.P({}, msg)); - + $("body").append(waitingMessageBoard); }; @@ -57,5 +84,5 @@ waitingMessageBoard = null; } }; - + })();