From 10437147677f6b0efeee0e2a989c56f0a5db25ac Mon Sep 17 00:00:00 2001 From: cgfhtw Date: Tue, 25 Oct 2022 09:51:20 +0200 Subject: [PATCH] adminMode in Sections --- public/js/components/Dashboard/Section.js | 31 ++++++++++++++--------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/public/js/components/Dashboard/Section.js b/public/js/components/Dashboard/Section.js index 7b2662709..2f4772504 100644 --- a/public/js/components/Dashboard/Section.js +++ b/public/js/components/Dashboard/Section.js @@ -4,16 +4,14 @@ import CachedWidgetLoader from "../../composables/Dashboard/CachedWidgetLoader.j // TODO(chris): handle overflow (moving outside the box) export default { - data: () => ({ - gridWidth: 0, - containerRect: {top:0,left:0}, - changeHeight: 1, - movedObjects: [], - editMode: 0, - gridXLast: 0, - gridYLast: 0, - dataTransfer: {} - }), + components: { + DashboardItem + }, + inject: { + adminMode: { + default: false + } + }, props: [ "adminMode", "name", @@ -24,8 +22,17 @@ export default { "widgetUpdate", "widgetRemove" ], - components: { - DashboardItem + data() { + return { + gridWidth: 0, + containerRect: {top:0,left:0}, + changeHeight: 1, + movedObjects: [], + editMode: this.adminMode ? 1 : 0, + gridXLast: 0, + gridYLast: 0, + dataTransfer: {} + } }, computed: { items() {