Permalink
Browse files

Only show color selector if needed

  • Loading branch information...
NEMS Linux
NEMS Linux committed Dec 30, 2018
1 parent b94be27 commit be240d59da408e6e0bc7fb1dd39fa1e2689f73a5
Showing with 14 additions and 2 deletions.
  1. +14 −2 config/index.php
@@ -243,7 +243,7 @@ function sanitize($string) {
<section>
<label class="label">Background Image</label>
<label class="select">
<select name="background">
<select name="background" id="background">
<option value="5"<?php if (!isset($nemsconf['background']) || $nemsconf['background'] == 5) echo ' SELECTED'; ?>>Default</option>
<option value="6"<?php if (isset($nemsconf['background']) && $nemsconf['background'] == 6) echo ' SELECTED'; ?>>Daily Image</option>
<option value="7"<?php if (isset($nemsconf['background']) && $nemsconf['background'] == 7) echo ' SELECTED'; ?>>Custom Color</option>
@@ -252,7 +252,19 @@ function sanitize($string) {
<i></i>
</label>
</section>
<section id="colorpicker"
<script>
$(function () {
$("#background").change(function() {
var val = $(this).val();
if(val === "7") {
$("#colorpicker").slideDown();
} else {
$("#colorpicker").slideUp();
}
});
});
</script>
<section id="colorpicker" style="display:none;">
<label class="label">Custom Background Color</label>
<label class="input">
<input type="text" id="bgcolor" name="backgroundColor" value="<?= $nemsconf['backgroundColor'] ?>">

0 comments on commit be240d5

Please sign in to comment.