From b52993f7ccebb8843543ea7192744d018457ce7b Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Wed, 26 Mar 2025 13:02:48 +0100 Subject: [PATCH] refactor(Grid Widgets drag): shows a placeholder item in the space where the new widget position would be when dragging a widget on the dashboard --- public/css/components/dashboard.css | 12 ++++++++- public/js/components/Dashboard/Item.js | 4 +-- public/js/components/Dashboard/Section.js | 5 ++-- public/js/components/Drop/Grid.js | 31 ++++++++++++++++++++--- public/js/components/Drop/Grid/Item.js | 2 ++ 5 files changed, 45 insertions(+), 9 deletions(-) diff --git a/public/css/components/dashboard.css b/public/css/components/dashboard.css index e742f7fa4..eb0c2bf78 100644 --- a/public/css/components/dashboard.css +++ b/public/css/components/dashboard.css @@ -40,5 +40,15 @@ cursor: move; } - +.dashboard-item-overlay::before{ + position:absolute; + content:""; + top:0; + left:0; + right:0; + bottom:0; + background-color:rgba(0, 100, 156); + border:1px dashed lightgray; + z-index: 2; +} diff --git a/public/js/components/Dashboard/Item.js b/public/js/components/Dashboard/Item.js index 59f33b711..c52c7887e 100644 --- a/public/js/components/Dashboard/Item.js +++ b/public/js/components/Dashboard/Item.js @@ -27,8 +27,8 @@ export default { "configClosed" ], props: [ - "index", "id", + "widgetID", "config", "width", "height", @@ -120,7 +120,7 @@ export default { -
+
diff --git a/public/js/components/Dashboard/Section.js b/public/js/components/Dashboard/Section.js index 387edf04e..7818e06b9 100644 --- a/public/js/components/Dashboard/Section.js +++ b/public/js/components/Dashboard/Section.js @@ -198,9 +198,10 @@ export default {