Skip to content

Commit

Permalink
fix routes file, add missing js file
Browse files Browse the repository at this point in the history
  • Loading branch information
orangewolf committed Sep 22, 2023
1 parent 61a9504 commit 363f9ee
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions app/assets/javascripts/admin_color_select.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
$(document).on('turbolinks:load', function() {
$('div.defaultable-colors a.restore-default-color').click(function(e) {
e.preventDefault()

var defaultTarget = $(e.target).data('default-target')
var input = $("input[name='admin_appearance["+ defaultTarget +"]']")

input.val(input.data('default-value'))
})

$('.panel-footer a.restore-all-default-colors').click(function(e) {
e.preventDefault()

var allColorInputs = $("input[name*='color']")

allColorInputs.each(function() {
$(this).val($(this).data('default-value'))
})
})
});

0 comments on commit 363f9ee

Please sign in to comment.