Don't track theme style tags with turbolinks

This commit is contained in:
Andreas Nedbal 2020-05-07 02:13:07 +02:00
parent 12955cc663
commit 3a4b04b5da
3 changed files with 3 additions and 3 deletions

View File

@ -103,6 +103,7 @@ if window.URL? or window.webkitURL?
# theming
previewStyle = document.createElement 'style'
previewStyle.setAttribute('data-turbolinks-track', 'false')
document.head.appendChild previewStyle
previewTimeout = null
@ -171,7 +172,6 @@ generateTheme = (payload) ->
console.log plKey
if theme_attribute_map[plKey]
if theme_attribute_map[plKey].includes 'text'
console.log "aaa"
hex = getHexColorFromThemeValue(payload[plKey])
body += "--#{theme_attribute_map[plKey]}: #{getDecimalTripletsFromHex(hex)};\n"
else

View File

@ -43,7 +43,7 @@ module ThemeHelper
body += "}"
content_tag(:style, body)
content_tag(:style, body, data: { "turbolinks-track": false })
end
def get_active_theme

View File

@ -18,7 +18,7 @@ describe ThemeHelper, :type => :helper do
end
it "returns a theme" do
expect(helper.render_theme).to include("<style>:root {")
expect(helper.render_theme).to include('<style data-turbolinks-track="false">:root {')
end
it "contains correct theme background colors" do