/[svn]/doc/tmpl/js/crd.js
ViewVC logotype

Diff of /doc/tmpl/js/crd.js

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3269 by schoenebeck, Fri Jun 2 11:59:21 2017 UTC revision 3270 by schoenebeck, Fri Jun 2 18:31:00 2017 UTC
# Line 6  Line 6 
6    
7  var g_isTouch = false;  var g_isTouch = false;
8    
9    function crdWindowWidth() {
10        return window.innerWidth ||
11               document.documentElement.clientWidth ||
12               document.getElementsByTagName('body')[0].clientWidth;
13    }
14    
15  function crdWindowHeight() {  function crdWindowHeight() {
16      return window.innerHeight ||      return window.innerHeight ||
17             document.documentElement.clientHeight ||             document.documentElement.clientHeight ||
# Line 55  function crdOnScroll() { Line 61  function crdOnScroll() {
61      }      }
62  }  }
63    
64    function crdUpdateTOCStatus() {
65        var noTOC = $("html").hasClass("no-toc");
66        $("nav > .foldbtn a").html(
67            noTOC ? ">>>" : "<<<"
68        );
69        $("nav > .foldbtn a").attr("title",
70            noTOC ? "Show content menu." : "Hide content menu."
71        )
72    }
73    
74    function crdToggleTOC() {
75        $("html").toggleClass("no-toc");
76        crdUpdateTOCStatus();
77    }
78    
79  function crdOnWindowResize() {  function crdOnWindowResize() {
80      var wh = crdWindowHeight();      var wh = crdWindowHeight();
81      $("nav > ul > li ul").css("max-height", wh - 70);      $("nav > ul > li ul").css("max-height", wh - 70);
# Line 84  $(function() { Line 105  $(function() {
105          $("header a[title]" ).tooltip({          $("header a[title]" ).tooltip({
106              disabled: true              disabled: true
107          });          });
108            $("nav a[title]" ).tooltip({
109                disabled: true
110            });
111      }      }
112      $("article img[caption]").each(function() {      $("article img[caption]").each(function() {
113          $(this).after(          $(this).after(
# Line 114  $(function() { Line 138  $(function() {
138              });              });
139          }          }
140      });      });
141        var w = crdWindowWidth();
142        if (w < 1200) {
143            $("html").addClass("no-toc");
144        }
145        crdUpdateTOCStatus();
146  });  });
147    
148  $(document).ready(function() {  $(document).ready(function() {

Legend:
Removed from v.3269  
changed lines
  Added in v.3270

  ViewVC Help
Powered by ViewVC