Skip to content

Commit d78d396

Browse files
committed
sync bugfixes, first dist
1 parent d53818a commit d78d396

File tree

6 files changed

+197
-193
lines changed

6 files changed

+197
-193
lines changed

dist/vue-grid-layout.js

Lines changed: 171 additions & 179 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-grid-layout.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-grid-layout.min.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/GridItem.vue

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
<slot></slot>
88
<!--span class="text">{{id}}</span-->
99
<!--<span class="text">{{i}}</span>-->
10-
<pre>
10+
<!--<pre>
1111
x: {{ x | json}}
1212
y: {{ y | json}}
1313
w: {{ w | json}}
1414
h: {{ h | json}}
15-
</pre>
15+
</pre>-->
1616
<span v-if="isResizable" v-el:handle class="vue-resizable-handle"></span>
1717
</div>
1818
</div>
@@ -110,7 +110,7 @@
110110
111111
</style>
112112
<script>
113-
import {setTopLeft, setTransform, createMarkup} from './utils';
113+
import {setTopLeft, setTransform, createMarkup, getLayoutItem} from './utils';
114114
115115
import {getControlPosition, offsetXYFromParentOf, createCoreData} from './draggableUtils';
116116
var VueDragDrop = require('vue-drag-and-drop');
@@ -261,7 +261,6 @@
261261
this.createStyle();
262262
},
263263
y: function() {
264-
console.log("### Y => " + this.y);
265264
this.createStyle();
266265
},
267266
h: function() {
@@ -330,7 +329,7 @@
330329
var pos = this.calcPosition(this.x, this.y, this.w, this.h);
331330
newSize.width = pos.width;
332331
newSize.height = pos.height;
333-
console.log("### resize end => " + JSON.stringify(newSize));
332+
// console.log("### resize end => " + JSON.stringify(newSize));
334333
this.resizing = null;
335334
this.isResizing = false;
336335
break;
@@ -531,6 +530,13 @@
531530
updateWidth: function(width) {
532531
this.containerWidth = width;
533532
},
533+
compact: function(layout) {
534+
var l = getLayoutItem(layout, this.id);
535+
this.x = l.x;
536+
this.y = l.y;
537+
this.h = l.h;
538+
this.w = l.w;
539+
}
534540
}
535541
}
536542
</script>

src/GridLayout.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@
125125
// Move the element to the dragged ___location.
126126
this.layout = moveElement(this.layout, l, x, y, true);
127127
this.layout = compact(this.layout, this.verticalCompact);
128+
// needed because vue can't detect changes on array element properties
129+
this.$broadcast("compact", this.layout);
130+
this.updateHeight();
128131
},
129132
resizeEvent: function(eventName, id, h, w) {
130133
if (eventName === "drag" && h < -40 && w < -40) {
@@ -141,7 +144,7 @@
141144
142145
// Move the element to the dragged ___location.
143146
this.layout = compact(this.layout, this.verticalCompact);
144-
this.updateHeight();
147+
this.$broadcast("compact", this.layout);
145148
},
146149
}
147150
}

src/ResponsiveGridLayout.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@
183183
if (eventName === "drag" && x == 0 && y == 0) {
184184
return;
185185
}
186-
console.log(eventName + " id=" + id + ", x=" + x + ", y=" + y);
186+
// console.log(eventName + " id=" + id + ", x=" + x + ", y=" + y);
187187
var l = getLayoutItem(this.layout, id);
188188
189189
/*
@@ -196,12 +196,15 @@
196196
// Move the element to the dragged ___location.
197197
this.layout = moveElement(this.layout, l, x, y, true);
198198
this.layout = compact(this.layout, this.verticalCompact);
199+
200+
// needed because vue can't detect changes on array element properties
201+
this.$broadcast("compact", this.layout);
202+
this.updateHeight();
199203
},
200204
resizeEvent: function(eventName, id, h, w) {
201205
if (eventName === "drag" && h < -40 && w < -40) {
202206
return;
203207
}
204-
// console.log(eventName + " id=" + id);
205208
206209
/*
207210
// Create placeholder (display only)

0 commit comments

Comments
 (0)