X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=Rakka.git;a=blobdiff_plain;f=js%2Fscreen.js;h=ef971839d572fd09edac06b24ba2bd0c8c032afe;hp=c30d0abeab9e869814483b71036e24f8324d6462;hb=01a4a132192ed8b65c8aa7b86cb0e9bc08b725ff;hpb=736016f6e7b9c4ce5cec6d2fe82f8d2911783f8f diff --git a/js/screen.js b/js/screen.js index c30d0ab..ef97183 100644 --- a/js/screen.js +++ b/js/screen.js @@ -1,12 +1,10 @@ (function () { - + var switchedArea = null; Rakka.switchScreen = function () { if (switchedArea == null) { switchedArea = $.DIV({}); - - $("div.sideBar div.outline").hide(); $("p.redirection").hide(); @@ -15,27 +13,41 @@ .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) { + $("p.redirection").show(); - $("div.sideBar div.outline").show(); + $(switchedArea).remove(); + switchedArea = null; - $("p.redirection").show(); + $("div.sideBarMask").remove(); - $(switchedArea).remove(); - switchedArea = null; - - $("div.body").children().show(); + $("div.body").children().show(); + } return null; }; @@ -43,6 +55,13 @@ return switchedArea; }; + Rakka.scrollToTopLeft = function () { + $("div.center").each(function () { + this.scrollTop = 0; + this.scrollLeft = 0; + }); + }; + var waitingMessageBoard = null; Rakka.displayWaitingMessage = function (msg) { @@ -51,7 +70,7 @@ waitingMessageBoard = $.P({className: "waitingMessageBoard"}, $.P({}, msg)); - + $("body").append(waitingMessageBoard); }; @@ -61,5 +80,5 @@ waitingMessageBoard = null; } }; - + })();