From 4a35477c35771aa18ead825ac500a55bf37f9e73 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Sat, 13 Oct 2018 09:18:16 +0200 Subject: [PATCH] Don't auto reload when database has changed in "fullscreen-card-mode" (fixes #88) --- public/js/grocy.js | 3 +-- public/js/grocy_dbchangedhandling.js | 2 +- public/viewjs/equipment.js | 2 +- public/viewjs/recipes.js | 1 + 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/js/grocy.js b/public/js/grocy.js index 2f6c171d..1d925244 100644 --- a/public/js/grocy.js +++ b/public/js/grocy.js @@ -338,6 +338,5 @@ ResizeResponsiveEmbeds = function(fillEntireViewport = false) } $(window).on('resize', function() { - console.log($("body").hasClass("fullscreen-responsive-embed-active")); - ResizeResponsiveEmbeds($("body").hasClass("fullscreen-responsive-embed-active")); + ResizeResponsiveEmbeds($("body").hasClass("fullscreen-card")); }); diff --git a/public/js/grocy_dbchangedhandling.js b/public/js/grocy_dbchangedhandling.js index 04f5cdaa..8c86b84a 100644 --- a/public/js/grocy_dbchangedhandling.js +++ b/public/js/grocy_dbchangedhandling.js @@ -22,7 +22,7 @@ setInterval(function() { if (Grocy.IdleTime >= 50) { - if (BoolVal(Grocy.UserSettings.auto_reload_on_db_change) && $("form.is-dirty").length === 0) + if (BoolVal(Grocy.UserSettings.auto_reload_on_db_change) && $("form.is-dirty").length === 0 && !$("body").hasClass("fullscreen-card")) { window.location.reload(); } diff --git a/public/viewjs/equipment.js b/public/viewjs/equipment.js index 58c7058a..fc3be5f9 100644 --- a/public/viewjs/equipment.js +++ b/public/viewjs/equipment.js @@ -116,7 +116,7 @@ $("#selectedEquipmentInstructionManualToggleFullscreenButton").on('click', funct $("#selectedEquipmentInstructionManualCard").toggleClass("fullscreen"); $("#selectedEquipmentInstructionManualCard .card-header").toggleClass("fixed-top"); $("#selectedEquipmentInstructionManualCard .card-body").toggleClass("mt-5"); - $("body").toggleClass("fullscreen-responsive-embed-active"); + $("body").toggleClass("fullscreen-card"); ResizeResponsiveEmbeds(true); }); diff --git a/public/viewjs/recipes.js b/public/viewjs/recipes.js index 44308ddd..a15b3f6c 100644 --- a/public/viewjs/recipes.js +++ b/public/viewjs/recipes.js @@ -158,6 +158,7 @@ recipesTables.on('select', function(e, dt, type, indexes) $("#selectedRecipeToggleFullscreenButton").on('click', function(e) { $("#selectedRecipeCard").toggleClass("fullscreen"); + $("body").toggleClass("fullscreen-card"); $("#selectedRecipeCard .card-header").toggleClass("fixed-top"); $("#selectedRecipeCard .card-body").toggleClass("mt-5"); });