Fix theme page not working

This commit is contained in:
Andreas Nedbal 2021-02-27 21:43:43 +01:00
parent fbac1f004a
commit c68e62efb3
2 changed files with 20 additions and 18 deletions

View File

@ -104,7 +104,8 @@ if window.URL? or window.webkitURL?
previewStyle = null
$(document).ready ->
$(document).on 'ready turbolinks:load', ->
if $('#update_theme').length > 0
previewStyle = document.createElement 'style'
document.body.appendChild previewStyle
@ -112,7 +113,7 @@ $(document).ready ->
$('#update_theme .color').each ->
$this = $ this
this.value = '#' + getHexColorFromThemeValue(this.value)
this.value = '#' + getHexColorFromThemeValue(this.dataset.default)
$this.minicolors
control: 'hue'
@ -124,7 +125,6 @@ $(document).ready ->
change: ->
clearTimeout previewTimeout
previewTimeout = setTimeout(previewTheme, 1000)
true
$(document).on 'click', 'a.theme_preset', (event) ->
preset = [].concat themePresets[this.dataset.preset]

View File

@ -8,6 +8,7 @@ import 'bootstrap'
import 'jquery.guillotine'
import 'particleground/jquery.particleground.min'
import 'jquery.growl'
import 'jquery-minicolors'
import 'sweetalert'
import Cookies from 'js-cookie'
import moment from 'moment'
@ -16,6 +17,7 @@ require('nprogress/nprogress.css')
require('jquery.growl/stylesheets/jquery.growl.css')
require('jquery.guillotine/css/jquery.guillotine.css')
require('sweetalert/dist/sweetalert.css')
require('jquery-minicolors/jquery.minicolors.css')
# this file is generated by Rails
import I18n from '../legacy/i18n'