Don't track theme style tags with turbolinks
This commit is contained in:
parent
12955cc663
commit
3a4b04b5da
|
@ -103,6 +103,7 @@ if window.URL? or window.webkitURL?
|
||||||
# theming
|
# theming
|
||||||
|
|
||||||
previewStyle = document.createElement 'style'
|
previewStyle = document.createElement 'style'
|
||||||
|
previewStyle.setAttribute('data-turbolinks-track', 'false')
|
||||||
document.head.appendChild previewStyle
|
document.head.appendChild previewStyle
|
||||||
|
|
||||||
previewTimeout = null
|
previewTimeout = null
|
||||||
|
@ -171,7 +172,6 @@ generateTheme = (payload) ->
|
||||||
console.log plKey
|
console.log plKey
|
||||||
if theme_attribute_map[plKey]
|
if theme_attribute_map[plKey]
|
||||||
if theme_attribute_map[plKey].includes 'text'
|
if theme_attribute_map[plKey].includes 'text'
|
||||||
console.log "aaa"
|
|
||||||
hex = getHexColorFromThemeValue(payload[plKey])
|
hex = getHexColorFromThemeValue(payload[plKey])
|
||||||
body += "--#{theme_attribute_map[plKey]}: #{getDecimalTripletsFromHex(hex)};\n"
|
body += "--#{theme_attribute_map[plKey]}: #{getDecimalTripletsFromHex(hex)};\n"
|
||||||
else
|
else
|
||||||
|
|
|
@ -43,7 +43,7 @@ module ThemeHelper
|
||||||
|
|
||||||
body += "}"
|
body += "}"
|
||||||
|
|
||||||
content_tag(:style, body)
|
content_tag(:style, body, data: { "turbolinks-track": false })
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_active_theme
|
def get_active_theme
|
||||||
|
|
|
@ -18,7 +18,7 @@ describe ThemeHelper, :type => :helper do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "returns a theme" do
|
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
|
end
|
||||||
|
|
||||||
it "contains correct theme background colors" do
|
it "contains correct theme background colors" do
|
||||||
|
|
Loading…
Reference in New Issue