Skip to content

Commit 3493be5

Browse files
committed
implemented jbaysolutions#34, 2.1.5 release
1 parent eacdc89 commit 3493be5

File tree

9 files changed

+39
-15
lines changed

9 files changed

+39
-15
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 2.1.5 (Mar 24, 2017)
4+
5+
* Really fixed #22 #32, multiple grid instances were not working properly in 2.1.4
6+
* resizedEvent now also returns item width and height in pixels (implements #34)
7+
8+
39
## 2.1.4 (Mar 20, 2017)
410

511
* Implemented #32, support for multiple grid instances on the same page

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
vue-grid-layout is a grid layout system, like [Gridster](http://dsmorse.github.io/gridster.js/), for Vue.js. **Heavily inspired in [React-Grid-Layout](https://github.com/STRML/react-grid-layout)**
44

5-
### **Current version:** 2.1.4 (Supports Vue 2.2+)
5+
### **Current version:** 2.1.5 (Supports Vue 2.2+)
66

77
### **For Vue 2.1.10 and below use version [2.1.3](https://github.com/jbaysolutions/vue-grid-layout/tree/2.1.3)**
88
### **For Vue 1 use version [1.0.0](https://github.com/jbaysolutions/vue-grid-layout/tree/1.0.0)**
@@ -190,8 +190,17 @@ Working example [here](https://jbaysolutions.github.io/vue-grid-layout/examples/
190190
* Resized event: every time an item is finished being resized and changes size
191191

192192
```javascript
193-
resizedEvent: function(i, newH, newW){
194-
console.log("RESIZED i=" + i + ", H=" + newH + ", W=" + newW);
193+
/**
194+
*
195+
* @param i the item id/index
196+
* @param newH new height in grid rows
197+
* @param newW new width in grid columns
198+
* @param newHPx new height in pixels
199+
* @param newWPx new width in pixels
200+
*
201+
*/
202+
resizedEvent: function(i, newH, newW, newHPx, newWPx){
203+
console.log("RESIZED i=" + i + ", H=" + newH + ", W=" + newW + ", H(px)=" + newHPx + ", W(px)=" + newWPx);
195204
},
196205
```
197206

dist/vue-grid-layout.js

Lines changed: 4 additions & 4 deletions
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: 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.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.

examples/02-events.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,17 @@ new Vue({
6464
console.log(msg);
6565

6666
},
67-
resizedEvent: function(i, newH, newW){
68-
var msg = "RESIZED i=" + i + ", H=" + newH + ", W=" + newW;
67+
/**
68+
*
69+
* @param i the item id/index
70+
* @param newH new height in grid rows
71+
* @param newW new width in grid columns
72+
* @param newHPx new height in pixels
73+
* @param newWPx new width in pixels
74+
*
75+
*/
76+
resizedEvent: function(i, newH, newW, newHPx, newWPx){
77+
var msg = "RESIZED i=" + i + ", H=" + newH + ", W=" + newW + ", H(px)=" + newHPx + ", W(px)=" + newWPx;
6978
this.eventLog.push(msg);
7079
console.log(msg);
7180
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-grid-layout",
3-
"version": "2.1.4",
3+
"version": "2.1.5",
44
"description": "A draggable and resizable grid layout, as a Vue component.",
55
"keywords": [
66
"grid",

src/App.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@
172172
moved: function(i, newX, newY){
173173
console.log("### MOVED i=" + i + ", X=" + newX + ", Y=" + newY);
174174
},
175-
resized: function(i, newH, newW){
176-
console.log("### RESIZED i=" + i + ", H=" + newH + ", W=" + newW);
175+
resized: function(i, newH, newW, newHPx, newWPx){
176+
console.log("### RESIZED i=" + i + ", H=" + newH + ", W=" + newW + ", H(px)=" + newHPx + ", W(px)=" + newWPx);
177177
},
178178
/**
179179
* Add change direction button

src/GridItem.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@
465465
this.$emit("resize", this.i, pos.h, pos.w);
466466
}
467467
if (event.type === "resizeend" && (this.previousW !== this.w || this.previousH !== this.h)) {
468-
this.$emit("resized", this.i, pos.h, pos.w);
468+
this.$emit("resized", this.i, pos.h, pos.w, newSize.width, newSize.height);
469469
}
470470
this.eventBus.$emit("resizeEvent", event.type, this.i, this.x, this.y, pos.h, pos.w);
471471
},

0 commit comments

Comments
 (0)