]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Fix public hashtag timeline width on mobile, fix scrollbar width compensation
authorThibaut Girka <thib@sitedethib.com>
Sun, 20 Jan 2019 10:56:21 +0000 (11:56 +0100)
committerThibaut Girka <thib@sitedethib.com>
Sun, 20 Jan 2019 10:56:21 +0000 (11:56 +0100)
Port 3b3a4d8a1709b8f4a9ffe67d21707117c75f9fe8 to glitch-soc

app/javascript/flavours/glitch/packs/public.js
app/javascript/flavours/glitch/styles/about.scss

index 56012ba784d2feec9da28ddef2f5bc466644c1e3..da0b4c8e0e9e03848efdbb00a114b4cb7f5c8fc4 100644 (file)
@@ -86,6 +86,14 @@ function main() {
     if (parallaxComponents.length > 0 ) {
       new Rellax('.parallax', { speed: -1 });
     }
+
+    if (document.body.classList.contains('with-modals')) {
+      const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
+      const scrollbarWidthStyle = document.createElement('style');
+      scrollbarWidthStyle.id = 'scrollbar-width';
+      document.head.appendChild(scrollbarWidthStyle);
+      scrollbarWidthStyle.sheet.insertRule(`body.with-modals--active { margin-right: ${scrollbarWidth}px; }`, 0);
+    }
   });
 }
 
index c8d144e5b1f1d52cd2f09e33020a86808660d8e8..e8f46766a80fb93759206b6c91fe53b16531c100 100644 (file)
@@ -366,7 +366,7 @@ $small-breakpoint: 960px;
 
   @media screen and (max-width: $column-breakpoint) {
     .grid {
-      grid-template-columns: auto;
+      grid-template-columns: 100%;
 
       .column-0 {
         display: block;