Skip to content

Commit

Permalink
Only show color selector if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
NEMS Linux committed Dec 30, 2018
1 parent b94be27 commit be240d5
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions config/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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'] ?>">
Expand Down

0 comments on commit be240d5

Please sign in to comment.