Selected view in Explorer is now visible

fixes #6
This commit is contained in:
Théo Marchal 2022-08-04 22:26:51 +02:00
parent adbd09c060
commit 56fd55d09d
4 changed files with 20 additions and 6 deletions

View File

@ -136,8 +136,8 @@
</form> </form>
<p class="no-result"><strong>Aucun résultat.</strong> Veuillez réessayer avec d'autres paramètres.</p> <p class="no-result"><strong>Aucun résultat.</strong> Veuillez réessayer avec d'autres paramètres.</p>
<div id="style-container"> <div id="style-container">
<img class="style-select list active" src="styles/icons/list.svg" alt="liste">
<img class="style-select frame" src="styles/icons/frame.svg" alt="galerie"> <img class="style-select frame" src="styles/icons/frame.svg" alt="galerie">
<img class="style-select list" src="styles/icons/list.svg" alt="liste">
</div> </div>
<div id="gallery"> <div id="gallery">
<div id="pagination"></div> <div id="pagination"></div>

View File

@ -527,6 +527,8 @@ jQuery(document).ready(function($)
{ {
$("table").hide(); $("table").hide();
$("#gallery").show(); $("#gallery").show();
$(".style-select.frame").addClass('active');
$(".style-select.list").removeClass('active');
window.localStorage.setItem('explorer-view', 'gallery'); window.localStorage.setItem('explorer-view', 'gallery');
} }
@ -534,6 +536,8 @@ jQuery(document).ready(function($)
{ {
$("#gallery").hide(); $("#gallery").hide();
$("table").show(); $("table").show();
$(".style-select.frame").removeClass('active');
$(".style-select.list").addClass('active');
window.localStorage.setItem('explorer-view', 'table'); window.localStorage.setItem('explorer-view', 'table');
} }
@ -545,11 +549,11 @@ jQuery(document).ready(function($)
{ {
if (res) if (res)
{ {
explorerView = window.localStorage.getItem('explorer-view'); explorerView = window.localStorage.getItem('explorer-view');
if (explorerView == "gallery") if (explorerView == "gallery")
setGallery(); setGallery();
else if (explorerView == "table") else if (explorerView == "table")
setTable(); setTable();
} }
} }

View File

@ -340,12 +340,16 @@ function userActionHandle(availableOptions)
{ {
$("table").hide(); $("table").hide();
$("#gallery").show(); $("#gallery").show();
$(".style-select.frame").addClass('active');
$(".style-select.list").removeClass('active');
window.localStorage.setItem('explorer-view', 'gallery'); window.localStorage.setItem('explorer-view', 'gallery');
}); });
$(".style-select.list").click(function() $(".style-select.list").click(function()
{ {
$("#gallery").hide(); $("#gallery").hide();
$("table").show(); $("table").show();
$(".style-select.frame").removeClass('active');
$(".style-select.list").addClass('active');
window.localStorage.setItem('explorer-view', 'table'); window.localStorage.setItem('explorer-view', 'table');
}); });
} }

View File

@ -511,9 +511,15 @@ article.explorer img.style-select {
margin-bottom:0.25rem; margin-bottom:0.25rem;
margin-right:0.4rem; margin-right:0.4rem;
margin-left:0.4rem; margin-left:0.4rem;
padding-bottom:6px;
cursor:pointer; cursor:pointer;
} }
article.explorer img.style-select.active {
border-bottom:2px solid black;
padding-bottom:4px;
}
article.explorer h3 { article.explorer h3 {
margin-bottom:0.3rem; margin-bottom:0.3rem;
} }