diff --git a/public/css/components/dashboard.css b/public/css/components/dashboard.css
index f48a25418..8770c1e78 100644
--- a/public/css/components/dashboard.css
+++ b/public/css/components/dashboard.css
@@ -18,6 +18,22 @@
position:relative;
}
+.dashboard-section > .newGridRow{
+ position:absolute;
+ width:20px;
+ height:20px;
+ padding:0;
+ bottom:0;
+ left:50%;
+ transform:translate(-50%, 50%);
+ background-color:white;
+}
+
+.newGridRow:hover {
+ color:white;
+ background-color:#6c757d;
+}
+
.empty-tile-hover:hover {
background-image: url('data:image/svg+xml;utf8,');
}
diff --git a/public/js/components/Dashboard/Item.js b/public/js/components/Dashboard/Item.js
index beaca64f0..68a92e701 100644
--- a/public/js/components/Dashboard/Item.js
+++ b/public/js/components/Dashboard/Item.js
@@ -42,7 +42,8 @@ export default {
"place",
"setup",
"dragstate",
- "resizeOverlay"
+ "resizeOverlay",
+ "additionalRow"
],
computed: {
maxHeight(){
diff --git a/public/js/components/Dashboard/Section.js b/public/js/components/Dashboard/Section.js
index fb5caa965..07e636cf5 100644
--- a/public/js/components/Dashboard/Section.js
+++ b/public/js/components/Dashboard/Section.js
@@ -41,6 +41,7 @@ export default {
gridWidth: 1,
gridHeight: null,
draggedItem:null,
+ additionalRow:false,
}
},
provide() {
@@ -214,7 +215,8 @@ export default {
{{sectionNameTranslation()}}:
-
+
+
{
@@ -120,6 +131,11 @@ export default {
if ((this.mode == MODE_MOVE || this.mode == MODE_RESIZE) && this.dragGrid){
return this.dragGrid.h;
}
+ if (this.mode == MODE_IDLE) {
+ if (this.additionalRowComputed) {
+ return this.grid ? (this.grid.h+1) : 1;
+ }
+ }
return this.grid ? this.grid.h : 1;
},
gridStyle() {
@@ -350,13 +366,8 @@ export default {
if (this.mode == MODE_IDLE) {
this.x = -1;
this.y = -1;
- if (this.additionalRow !== null) {
- let gridHeight = this.grid.getMaxY() + 1;
- if(this.grid.h>gridHeight){
- this.grid.h = gridHeight;
- }
- this.additionalRow = null;
- }
+ this.additionalRowComputed = false;
+
}
},
updateCursor(evt) {
@@ -380,18 +391,6 @@ export default {
if (this.x == gridX && this.y == gridY)
return false;
- if (this.mode == MODE_IDLE) {
- if (this.additionalRow === null && this.y == this.rows-1 && gridY == this.rows) {
- this.additionalRow = this.grid.h;
- this.grid.h += 1;
- } else if (this.additionalRow !== null && gridY != this.rows - 1) {
- let gridHeight = this.grid.getMaxY() + 1;
- if(this.grid.h > gridHeight){
- this.grid.h = gridHeight;
- }
- this.additionalRow = null;
- }
- }
this.x = gridX;
this.y = gridY;
@@ -482,6 +481,7 @@ export default {
}
},
dragCancel() {
+ this.additionalRowComputed = false;
this.toggleDraggedItemOverlay(false);
this.mode = MODE_IDLE;
this.positionUpdates = null;
@@ -531,6 +531,7 @@ export default {
return updated;
},
emptyTileClicked() {
+ this.additionalRowComputed = false;
this.$emit('newItem', this.x, this.y);
},
updateCursorOnMouseMove(evt){