From 201bda93a2c1b0d0e2f039198d5bb5a564d52d1d Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Fri, 10 Jan 2025 17:15:09 +0100 Subject: [PATCH] Revamped modal iframe dialog handling --- changelog/77_UNRELEASED_xxxx-xx-xx.md | 4 +- package.json | 2 - public/css/grocy.css | 18 +++- public/js/grocy.js | 103 ++++++++++++++------ public/js/grocy_datatables.js | 4 +- public/viewjs/components/barcodescanner.js | 4 +- public/viewjs/consume.js | 4 +- public/viewjs/equipment.js | 2 +- public/viewjs/inventory.js | 4 +- public/viewjs/mealplan.js | 2 +- public/viewjs/productbarcodeform.js | 8 +- public/viewjs/productgroupform.js | 4 +- public/viewjs/productgroups.js | 2 +- public/viewjs/purchase.js | 8 +- public/viewjs/quantityunitconversionform.js | 8 +- public/viewjs/recipeform.js | 4 +- public/viewjs/recipeposform.js | 4 +- public/viewjs/recipes.js | 4 +- public/viewjs/shoppinglist.js | 8 +- public/viewjs/shoppinglistform.js | 4 +- public/viewjs/shoppinglistitemform.js | 16 +-- public/viewjs/stockentries.js | 17 +++- public/viewjs/stockentryform.js | 5 +- public/viewjs/transfer.js | 4 +- views/about.blade.php | 2 + views/batteriesoverview.blade.php | 3 +- views/choresoverview.blade.php | 3 +- views/layout/default.blade.php | 4 - views/recipes.blade.php | 2 +- views/stockentries.blade.php | 6 +- views/stockjournal.blade.php | 6 +- views/stockoverview.blade.php | 7 +- yarn.lock | 17 ---- 33 files changed, 175 insertions(+), 118 deletions(-) diff --git a/changelog/77_UNRELEASED_xxxx-xx-xx.md b/changelog/77_UNRELEASED_xxxx-xx-xx.md index c841fe15..20666abb 100644 --- a/changelog/77_UNRELEASED_xxxx-xx-xx.md +++ b/changelog/77_UNRELEASED_xxxx-xx-xx.md @@ -54,7 +54,9 @@ ### General -- xxx +- Optimized nested modal dialogs: + - Nested dialogs are now no longer displayed "in each other" and instead "on top of each other" + - Wide dialogs (e.g. all showing a table, like showing stock entries of a product from the stock overview more/context menu per line) now use the full screen width ### API diff --git a/package.json b/package.json index 217625f6..e719e6cb 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,6 @@ "@ericblade/quagga2": "^1.2.1", "@fontsource/roboto": "^5.1.1", "@fortawesome/fontawesome-free": "^6.1.1", - "@iframe-resizer/child": "^5.3.2", - "@iframe-resizer/parent": "^5.3.2", "animate.css": "^3.7.2", "bootbox": "^6.0.0", "bootstrap": "^4.5.2", diff --git a/public/css/grocy.css b/public/css/grocy.css index e7e6e8de..86a7a8ae 100755 --- a/public/css/grocy.css +++ b/public/css/grocy.css @@ -113,9 +113,6 @@ button.disabled { iframe.embed-responsive { border: 0; - width: 1px; - min-width: 100%; - min-height: 700px; } /* Hide the default up/down arrow buttons for number inputs because we use our own buttons in numberpicker */ @@ -278,6 +275,21 @@ a:not([href]) { z-index: 99998; } +@media (min-width: 576px) { + .form .modal-dialog { + max-width: 650px; + } + + .table .modal-dialog { + max-width: 90%; + } +} + +.dropdown-menu { + max-height: 100vh; + overflow-y: auto; +} + /* Third party component customizations - DataTables */ .dataTable td { vertical-align: middle !important; diff --git a/public/js/grocy.js b/public/js/grocy.js index a57cab8d..ec41f9d9 100644 --- a/public/js/grocy.js +++ b/public/js/grocy.js @@ -538,28 +538,39 @@ if ($(".custom-file-label").length > 0) $("