From d82b7006e8b9bc8105a8204f018b29a1b57cc61d Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sat, 9 May 2020 01:57:20 +0200 Subject: [PATCH] Fix turbolinks loading being broken --- app/assets/javascripts/settings.coffee | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/settings.coffee b/app/assets/javascripts/settings.coffee index bdc5c6b0..b2626aca 100644 --- a/app/assets/javascripts/settings.coffee +++ b/app/assets/javascripts/settings.coffee @@ -102,13 +102,14 @@ if window.URL? or window.webkitURL? # theming -previewStyle = document.createElement 'style' -previewStyle.setAttribute('data-turbolinks-track', 'false') -document.head.appendChild previewStyle - -previewTimeout = null +previewStyle = null $(document).ready -> + previewStyle = document.createElement 'style' + document.body.appendChild previewStyle + + previewTimeout = null + $('#update_theme .color').each -> $this = $ this this.value = '#' + getHexColorFromThemeValue(this.value)