From 5079756d878af57cdf7257c502562696e8fea14d Mon Sep 17 00:00:00 2001 From: Thibaut Date: Sat, 6 Sep 2014 17:31:16 -0400 Subject: [PATCH] Show message when JavaScript is disabled --- assets/javascripts/app/app.coffee | 1 + assets/stylesheets/components/_app.scss | 3 +++ assets/stylesheets/components/_fail.scss | 1 + views/index.erb | 3 ++- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/assets/javascripts/app/app.coffee b/assets/javascripts/app/app.coffee index c652f993..4042d058 100644 --- a/assets/javascripts/app/app.coffee +++ b/assets/javascripts/app/app.coffee @@ -101,6 +101,7 @@ return showLoading: -> + document.body.classList.remove '_noscript' document.body.classList.add '_loading' return diff --git a/assets/stylesheets/components/_app.scss b/assets/stylesheets/components/_app.scss index 44bd5d61..ccc7011b 100644 --- a/assets/stylesheets/components/_app.scss +++ b/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; } diff --git a/assets/stylesheets/components/_fail.scss b/assets/stylesheets/components/_fail.scss index e74716c0..2dcc66b5 100644 --- a/assets/stylesheets/components/_fail.scss +++ b/assets/stylesheets/components/_fail.scss @@ -1,4 +1,5 @@ ._fail { + display: block; position: relative; top: 1.5rem; width: 24rem; diff --git a/views/index.erb b/views/index.erb index 1a116057..f5c40ae5 100644 --- a/views/index.erb +++ b/views/index.erb @@ -29,6 +29,7 @@ <%= javascript_tag 'docs' %><% unless App.production? %> <%= javascript_tag 'debug' %><% end %> - + + <%= erb :app %>