Skip to content

Commit 6eb10b9

Browse files
committed
implements jbaysolutions#13, dynamic rowHeight
1 parent b573475 commit 6eb10b9

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

src/App.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@
2121
<input type="checkbox" v-model="draggable"/> Draggable
2222
<input type="checkbox" v-model="resizable"/> Resizable
2323
<br/>
24+
Row Height: <input type="number" v-model="rowHeight"/>
25+
<br/>
2426
<grid-layout
2527
:layout="layout"
2628
:col-num="12"
27-
:row-height="30"
29+
:row-height="rowHeight"
2830
:is-draggable="draggable"
2931
:is-resizable="resizable"
3032
:vertical-compact="true"
@@ -93,6 +95,7 @@
9395
layout: JSON.parse(JSON.stringify(testLayout)),
9496
draggable: true,
9597
resizable: true,
98+
rowHeight: 30,
9699
colNum: 0,
97100
index: 0
98101
}

src/GridItem.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,11 @@
202202
eventBus.$on('setResizable', function(isResizable) {
203203
self.isResizable = isResizable;
204204
});
205-
/*eventBus.$on('setRowHeight', function(rowHeight) {
206-
this.rowHeight = rowHeight;
205+
eventBus.$on('setRowHeight', function(rowHeight) {
206+
self.rowHeight = rowHeight;
207207
});
208-
eventBus.$on('setColNum', function(colNum) {
209-
this.cols = colNum;
208+
/*eventBus.$on('setColNum', function(colNum) {
209+
self.cols = colNum;
210210
});*/
211211
var direction = (document.dir !=undefined) ?
212212
document.dir :
@@ -275,6 +275,9 @@
275275
});
276276
}
277277
},
278+
rowHeight: function() {
279+
this.createStyle();
280+
},
278281
cols: function() {
279282
this.createStyle();
280283
},

src/GridLayout.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@
152152
layout: function () {
153153
this.layoutUpdate();
154154
},
155+
rowHeight: function() {
156+
eventBus.$emit("setRowHeight", this.rowHeight);
157+
},
155158
isDraggable: function() {
156159
eventBus.$emit("setDraggable", this.isDraggable);
157160
},

0 commit comments

Comments
 (0)