]> gitweb @ CieloNegro.org - Rakka.git/blobdiff - js/screen.js
stylesheet changes
[Rakka.git] / js / screen.js
index 0ac558b9f6da97e52bcf479f8f2c9e937f1a7efb..ef971839d572fd09edac06b24ba2bd0c8c032afe 100644 (file)
@@ -1,40 +1,67 @@
 (function () {
-    
+
     var switchedArea = null;
 
     Rakka.switchScreen = function () {
         if (switchedArea == null) {
             switchedArea = $.DIV({});
-            
-            $("div.sideBar div.outline").hide();
+
+            $("p.redirection").hide();
 
             $("div.body")
                 .children()
                     .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;
 
-        $(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) {
@@ -43,7 +70,7 @@
         waitingMessageBoard
             = $.P({className: "waitingMessageBoard"},
                   $.P({}, msg));
-        
+
         $("body").append(waitingMessageBoard);
     };
 
@@ -53,5 +80,5 @@
             waitingMessageBoard = null;
         }
     };
-    
+
 })();