another minor toc issue
authorHanoh Haim <[email protected]>
Mon, 2 May 2016 12:05:35 +0000 (15:05 +0300)
committerHanoh Haim <[email protected]>
Mon, 2 May 2016 12:05:35 +0000 (15:05 +0300)
trex_toc.asciidoc

index 2eb2d2b..46c51c2 100644 (file)
@@ -214,13 +214,16 @@ ifdef::backend-xhtml11[]
           // On resize
           $("#toc").resizable({
               resize: function(e, ui) {
-                  var tocWidth = $(toc).outerWidth();
-                  body.css({"marginLeft":parseInt(tocWidth)+20+"px"}); 
-                  $(".ui-resizable-e").css({"right":$(window).width()-parseInt(tocWidth)+"px"}); 
-                  $("#toctitle").css({"width":parseInt(tocWidth)-45+"px"}); 
+                  resized();
               },
               handles: 'e'
           });
+          
+        // On zoom changed
+          $(window).resize(function() {
+            resized();
+          });
+
        
           // Do it for the first time
           var tocWidth = $(toc).outerWidth();
@@ -229,6 +232,16 @@ ifdef::backend-xhtml11[]
 
         }
 
+        function resized(){
+          var body = $("body");
+          var tocWidth = $(toc).outerWidth();
+          
+          body.css({"marginLeft":parseInt(tocWidth)+20+"px"}); 
+          $(".ui-resizable-e").css({"right":$(window).width()-parseInt(tocWidth)+"px"}); 
+          $("#toctitle").css({"width":parseInt(tocWidth)-45+"px"}); 
+        }
+
+
         function toggleTOC(){
           var isOpen = true;
           $( "#toggle" ).click(function() {