Don't try to switch twice to shopping list compact mode on mobile (references #453)

This commit is contained in:
Bernd Bestel
2020-01-25 08:49:17 +01:00
parent 3cbeea7d95
commit 061f4da041
2 changed files with 6 additions and 6 deletions

View File

@@ -354,7 +354,7 @@ $(document).on("click", "#clear-description-button", function(e)
$("#save-description-button").click();
});
$(".fullscreen-shopping-list-button").on('click', function(e)
$(".switch-view-mode-button").on('click', function(e)
{
e.preventDefault();
@@ -365,7 +365,7 @@ $(".fullscreen-shopping-list-button").on('click', function(e)
if ($("body").hasClass("fullscreen-card"))
{
window.location.hash = "#fullscreen";
window.location.hash = "#compact";
}
else
{
@@ -376,13 +376,13 @@ $(".fullscreen-shopping-list-button").on('click', function(e)
$("#description").trigger("summernote.change");
$("#save-description-button").addClass("disabled");
if (window.location.hash === "#fullscreen")
if (window.location.hash === "#compact")
{
$("#shopping-list-compact-view-button").click();
}
// Auto switch to compact view on mobile
if ($(window).width() < 768)
if ($(window).width() < 768 & window.location.hash !== "#compact")
{
$("#shopping-list-compact-view-button").click();
}