]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- use relative/absolute positioning and greatly simplify everything,
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 27 May 2014 17:24:58 +0000 (13:24 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 27 May 2014 17:24:58 +0000 (13:24 -0400)
works in chrome + safari

doc/build/static/docs.css
doc/build/static/init.js

index f9d60a45a9ff2fd3267159ba12c4dd7e85388aff..a740fc4266dae3b124d646d0dc3215be69d30afa 100644 (file)
@@ -62,6 +62,7 @@ a.headerlink:hover {
 #docs-container {
   max-width:1000px;
   margin: 0 auto;
+  position: relative;
 }
 
 
@@ -184,11 +185,19 @@ a.headerlink:hover {
 
   border: solid 1px #CCC;
 
-  float:left;
-  min-height: 700px;
   z-index: 3;
   background-color: #EFEFEF;
 
+  position: absolute;
+  top: 120px;
+  bottom: 0;
+  min-height: 0;
+  overflow-y: auto;
+}
+
+
+#docs-top-navigation-container {
+    background-color:#FFF;
 }
 
 #docs-top-navigation-container.automated {
@@ -199,11 +208,6 @@ a.headerlink:hover {
     background-color:#FFF;
 }
 
-#docs-sidebar.preautomated {
-  overflow-y: auto;
-  bottom: 0;
-}
-
 /* http://css-tricks.com/hash-tag-links-padding/ */
 #docs-container.preautomated div.section:before {
     content: " ";
@@ -213,8 +217,15 @@ a.headerlink:hover {
     visibility: hidden;
 }
 
+
+#docs-sidebar.preautomated:after {
+  content: " ";
+  display:block;
+  height: 150px;
+}
+
+
 #docs-sidebar.automated {
-    float: none;
     position: fixed;
     top: 120px;
     min-height: 0;
index 6ea218e1def87f9d5b27aa020919d7c2506bc040..0d3e678ba69fb63210f22e749e63aa2d172aeec7 100644 (file)
@@ -11,24 +11,16 @@ var automatedBreakpoint = -1;
 
 function initFloatyThings() {
 
-    automatedBreakpoint = $("#docs-top-navigation-container").position().top;
-
-    parentOffset = $("#docs-container").parent().position().top - $("#docs-container").position().top;
+    automatedBreakpoint = $("#docs-container").position().top;
     containerHeight = $("#docs-top-navigation-container").height();
 
-    sidebar = $("#docs-sidebar").position();
-    if (sidebar) {
-        margin = sidebar.top - (automatedBreakpoint + containerHeight);
-    }
-    else {
-        margin = 0;
-    }
-    autoOffset = containerHeight + margin - parentOffset;
+    // TODO: calculate the '9' here
+    autoOffset = containerHeight + 9;
 
+    $("#docs-top-navigation-container").addClass("preautomated");
     $("#docs-sidebar").addClass("preautomated");
     $("#docs-container").addClass("preautomated");
 
-
     function setNavSize() {
         $("#docs-top-navigation-container").css("width", $("#docs-container").width());
     }
@@ -40,15 +32,12 @@ function initFloatyThings() {
             setNavSize();
             $("#docs-top-navigation-container").addClass("automated");
             $("#docs-sidebar").addClass("automated");
-            $("#docs-container").addClass("automated");
             $("#docs-body").css("margin-top", autoOffset);
         }
         else {
-            $("#docs-top-navigation-container.automated").css("width", "");
             $("#docs-sidebar.automated").scrollTop(0);
-            $("#docs-top-navigation-container").removeClass("automated");
-            $("#docs-container").removeClass("automated");
             $("#docs-sidebar").removeClass("automated");
+            $("#docs-top-navigation-container").removeClass("automated");
             $("#docs-body").css("margin-top", "");
         }