]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
more tweaks
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 26 May 2014 20:40:24 +0000 (16:40 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 26 May 2014 20:40:24 +0000 (16:40 -0400)
doc/build/static/docs.css
doc/build/static/init.js

index 9797bbf6588ef558477a0cd33f6351bf8a711788..f9d60a45a9ff2fd3267159ba12c4dd7e85388aff 100644 (file)
@@ -199,12 +199,25 @@ 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: " ";
+    display: block;
+    height:100px;
+    margin-top: -100px;
+    visibility: hidden;
+}
+
 #docs-sidebar.automated {
     float: none;
     position: fixed;
-    top: 96px;
-    bottom: 0;
-    overflow-y: auto;
+    top: 120px;
+    min-height: 0;
 }
 
 
index 8422fe12cd0692f3d2b228c4a575e35f7265ecbe..6ea218e1def87f9d5b27aa020919d7c2506bc040 100644 (file)
@@ -11,30 +11,48 @@ var automatedBreakpoint = -1;
 
 function initFloatyThings() {
 
-    automatedBreakpoint = $("#docs-top-navigation-container").offset().top;
-    autoOffset = $("#docs-container").offset().top;
+    automatedBreakpoint = $("#docs-top-navigation-container").position().top;
+
+    parentOffset = $("#docs-container").parent().position().top - $("#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;
+
+    $("#docs-sidebar").addClass("preautomated");
+    $("#docs-container").addClass("preautomated");
+
+
     function setNavSize() {
         $("#docs-top-navigation-container").css("width", $("#docs-container").width());
     }
 
     function setScroll() {
+
         var scrolltop = $(window).scrollTop();
         if (scrolltop >= automatedBreakpoint) {
             setNavSize();
             $("#docs-top-navigation-container").addClass("automated");
             $("#docs-sidebar").addClass("automated");
-            $("#docs-sidebar").css("top", $("#docs-top-navigation-container").height());
-            $("#docs-body").css("margin-top",
-                                    $("#docs-top-navigation-container").height() +
-                                    autoOffset);
+            $("#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-body").css("margin-top", "");
         }
+
+
     }
     $(window).scroll(setScroll)