Improve UI

This commit is contained in:
Jay Trees 2022-01-18 15:19:27 +01:00
parent 5240352909
commit f16bf3358b
3 changed files with 10 additions and 3 deletions

View file

@ -9,10 +9,16 @@ $(function() {
if (wishlistValue) { if (wishlistValue) {
$('.wishlist-view').removeClass('disabled'); $('.wishlist-view').removeClass('disabled');
} else {
$('.wishlist-view').addClass('disabled');
}
const urlParams = new URLSearchParams(window.location.search);
if (wishlistValue === urlParams.get('wishlist')) {
$('.wishlist-share').removeClass('disabled'); $('.wishlist-share').removeClass('disabled');
$('.wishlist-delete button').removeClass('disabled'); $('.wishlist-delete button').removeClass('disabled');
} else { } else {
$('.wishlist-view').addClass('disabled');
$('.wishlist-share').addClass('disabled'); $('.wishlist-share').addClass('disabled');
$('.wishlist-delete button').addClass('disabled'); $('.wishlist-delete button').addClass('disabled');
} }

View file

@ -31,6 +31,7 @@ $page->navigation();
</div> </div>
<div class="field"> <div class="field">
<label>Wishlist</label>
<select class="ui search selection dropdown loading wishlists" name="wishlist"> <select class="ui search selection dropdown loading wishlists" name="wishlist">
<option value="">Loading your wishlists...</option> <option value="">Loading your wishlists...</option>
</select> </select>

View file

@ -60,7 +60,7 @@ if (isset($_POST['wishlist_delete_id'])) {
<h2 class="ui header">Options</h1> <h2 class="ui header">Options</h1>
<p>Wishlist related options.</p> <p>Wishlist related options.</p>
<a class="ui small labeled icon button wishlist-share disabled" href="/?wishlist=<?= $wishlist['hash'] ?? '' ?>" target="_blank"> <a class="ui small labeled icon button wishlist-share <?= !isset($_GET['wishlist']) ? 'disabled' : '' ?>" href="/?wishlist=<?= $wishlist['hash'] ?? '' ?>" target="_blank">
<i class="share icon"></i> <i class="share icon"></i>
Share Share
</a> </a>
@ -68,7 +68,7 @@ if (isset($_POST['wishlist_delete_id'])) {
<form class="ui form wishlist-delete" method="post" style="display: inline-block;"> <form class="ui form wishlist-delete" method="post" style="display: inline-block;">
<input type="hidden" name="wishlist_delete_id" /> <input type="hidden" name="wishlist_delete_id" />
<button class="ui small labeled red icon button disabled" type="submit"> <button class="ui small labeled red icon button <?= !isset($_GET['wishlist']) ? 'disabled' : '' ?>" type="submit">
<i class="trash icon"></i> <i class="trash icon"></i>
Delete Delete
</button> </button>