Only include transifex JS if the ENV var is set

... otherwise, don't bother loading this blocking external resource.
This commit is contained in:
James Mason
2017-11-12 20:43:02 -08:00
parent 0e16b5d0ae
commit fba12aef24

View File

@@ -9,15 +9,16 @@
= javascript_include_tag "application"
= csrf_meta_tags
:javascript
window.liveSettings = {
api_key: "#{ENV['OSEM_TRANSIFEX_APIKEY']}",
picker: "bottom-right",
detectlang: true,
autocollect: true
};
= content_for(:script_head)
= javascript_include_tag "//cdn.transifex.com/live.js"
- if ENV['OSEM_TRANSIFEX_APIKEY']
:javascript
window.liveSettings = {
api_key: "#{ENV['OSEM_TRANSIFEX_APIKEY']}",
picker: "bottom-right",
detectlang: true,
autocollect: true
};
= javascript_include_tag "//cdn.transifex.com/live.js"
= yield(:head)
%body