Procházet zdrojové kódy

HUE-8153 [docs] TOC Search input should have a fixed position

Enrico Berti před 7 roky
rodič
revize
e2057524e9
2 změnil soubory, kde provedl 18 přidání a 4 odebrání
  1. 14 2
      docs/css/docbook.css
  2. 4 2
      docs/js/hue-docs.js

+ 14 - 2
docs/css/docbook.css

@@ -265,18 +265,30 @@ pre {
 .toc {
   background-color: #F6F6F6;
   padding: 10px;
+  padding-top: 0;
   position: fixed;
   overflow-y: auto;
-  height: calc(100% - 95px);
+  height: calc(100% - 85px);
   width: 22%;
 }
 
+.toc > ul {
+  margin-top: 50px;
+}
+
 .toc ul {
   margin-left: 10px;
   list-style: none;
 }
 
-#tocFilter {
+.toc-filter-container {
+  padding-top: 10px;
+  background-color: #F6F6F6;
+  width: 21%;
+  position: fixed;
+}
+
+.toc-filter {
   width: 100%;
 }
 

+ 4 - 2
docs/js/hue-docs.js

@@ -17,8 +17,10 @@
 $(document).ready(function () {
   $('.doc-title h1 a').html('<img src="../images/hue_logo.png" alt="Hue Logo">');
   $('.toc ul').treed();
-  var $tocFilter = $('<input id="tocFilter" type="text">').addClass('form-control').attr('placeholder', 'Filter Table of Content');
-  $tocFilter.prependTo($('.toc'));
+  var $tocFilterContainer = $('<div>').addClass('toc-filter-container');
+  $tocFilterContainer.prependTo($('.toc'));
+  var $tocFilter = $('<input type="text">').addClass('form-control toc-filter').attr('placeholder', 'Filter Table of Content');
+  $tocFilter.appendTo($tocFilterContainer);
   var tocTimeout = -1;
   $tocFilter.on('keyup', function (e) {
     if (![13, 37, 38, 39, 40].indexOf(e.keyCode) > -1) {