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,27 +104,27 @@ if window.URL? or window.webkitURL?
previewStyle = null
$(document).ready ->
previewStyle = document.createElement 'style'
document.body.appendChild previewStyle
$(document).on 'ready turbolinks:load', ->
if $('#update_theme').length > 0
previewStyle = document.createElement 'style'
document.body.appendChild previewStyle
previewTimeout = null
previewTimeout = null
$('#update_theme .color').each ->
$this = $ this
this.value = '#' + getHexColorFromThemeValue(this.value)
$('#update_theme .color').each ->
$this = $ this
this.value = '#' + getHexColorFromThemeValue(this.dataset.default)
$this.minicolors
control: 'hue'
defaultValue: this.value
letterCase: 'lowercase'
position: 'bottom left'
theme: 'bootstrap'
inline: false
change: ->
clearTimeout previewTimeout
previewTimeout = setTimeout(previewTheme, 1000)
true
$this.minicolors
control: 'hue'
defaultValue: this.value
letterCase: 'lowercase'
position: 'bottom left'
theme: 'bootstrap'
inline: false
change: ->
clearTimeout previewTimeout
previewTimeout = setTimeout(previewTheme, 1000)
$(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'