2 Commits 8bc8155b20 ... a17f6cce19

Auteur SHA1 Message Date
  Adrien Nader a17f6cce19 eur-lex: prefer CSS' resize to the toggle button. il y a 8 ans
  Adrien Nader f679ff4fb1 eur-lex: don't hide the toc fully but shrink it to 0px vertically. il y a 8 ans
1 fichiers modifiés avec 9 ajouts et 2 suppressions
  1. 9 2
      eur-lex/eur-lex_toc.user.js

+ 9 - 2
eur-lex/eur-lex_toc.user.js

@@ -25,6 +25,7 @@ style.innerHTML = '\
   direction: ltr;\
   overflow-x: auto;\
   background-color: antiquewhite;\
+  resize: both;\
 }\
 #the-toc-this-website-lacks li {\
   padding: 0.5em;\
@@ -46,6 +47,10 @@ var ol_articles = document.createElement('ol');
 var h1_annexes = document.createElement('h1');
 var ol_annexes = document.createElement('ol');
 
+toc.style = "resize: both;";
+var has_css_resize = (toc.style !== "");
+toc.style = "";
+
 h1_articles.textContent = 'Articles';
 h1_annexes.textContent = 'Annexes';
 
@@ -96,11 +101,13 @@ visibility_button.onclick = (function() {
   var visible = true;
   return function() {
     visible = ! visible;
-    toc_ltr.style = visible ? "" : "display: none;";
+    toc_ltr.style = visible ? "" : "height: 0px;";
   }
 })();
 
-toc.appendChild(visibility_button);
+if (! has_css_resize) {
+  toc.appendChild(visibility_button);
+}
 if (article_titles.snapshotLength > 0) {
   toc_ltr.appendChild(h1_articles);
   toc_ltr.appendChild(ol_articles);