Browse Source

Show message when JavaScript is disabled

Thibaut 11 years ago
parent
commit
5079756d87

+ 1 - 0
assets/javascripts/app/app.coffee

@@ -101,6 +101,7 @@
     return
 
   showLoading: ->
+    document.body.classList.remove '_noscript'
     document.body.classList.add '_loading'
     return
 

+ 3 - 0
assets/stylesheets/components/_app.scss

@@ -9,6 +9,7 @@
   @extend %border-box;
 
   ._booting > & { opacity: 0; }
+  ._noscript > & { display: none; }
 }
 
 ._booting {
@@ -33,3 +34,5 @@
             transition: opacity .1s .3s;
   }
 }
+
+._noscript { opacity: 1; }

+ 1 - 0
assets/stylesheets/components/_fail.scss

@@ -1,4 +1,5 @@
 ._fail {
+  display: block;
   position: relative;
   top: 1.5rem;
   width: 24rem;

+ 2 - 1
views/index.erb

@@ -29,6 +29,7 @@
   <%= javascript_tag 'docs' %><% unless App.production? %>
   <%= javascript_tag 'debug' %><% end %>
 </head>
-<body class="_booting">
+<body class="_booting _noscript">
+<noscript class="_fail">DevDocs requires JavaScript to run.</noscript>
 <%= erb :app %></body>
 </html>