|
6 | 6 | <div class="layoutJSON"> |
7 | 7 | Displayed as <code>[x, y, w, h]</code>: |
8 | 8 | <div class="columns"> |
9 | | - <div class="layoutItem" v-for="item in layout"> |
| 9 | + <div class="layoutItem" v-for="item in layout" :key="item.i"> |
10 | 10 | <b>{{item.i}}</b>: [{{item.x}}, {{item.y}}, {{item.w}}, {{item.h}}] |
11 | 11 | </div> |
12 | 12 | </div> |
|
146 | 146 | clicked: function() { |
147 | 147 | window.alert("CLICK!"); |
148 | 148 | }, |
149 | | - increaseWidth: function(item) { |
150 | | - var width = document.getElementById("content").offsetWidth; |
| 149 | + increaseWidth: function() { |
| 150 | + let width = document.getElementById("content").offsetWidth; |
151 | 151 | width += 20; |
152 | 152 | document.getElementById("content").style.width = width+"px"; |
153 | 153 | }, |
154 | | - decreaseWidth: function(item) { |
155 | | -
|
156 | | - var width = document.getElementById("content").offsetWidth; |
| 154 | + decreaseWidth: function() { |
| 155 | + let width = document.getElementById("content").offsetWidth; |
157 | 156 | width -= 20; |
158 | 157 | document.getElementById("content").style.width = width+"px"; |
159 | 158 | }, |
|
162 | 161 | this.layout.splice(this.layout.indexOf(item), 1); |
163 | 162 | }, |
164 | 163 | addItem: function() { |
165 | | - let self = this; |
| 164 | + // let self = this; |
166 | 165 | //console.log("### LENGTH: " + this.layout.length); |
167 | 166 | let item = {"x":0,"y":0,"w":2,"h":2,"i":this.index+"", whatever: "bbb"}; |
168 | 167 | this.index++; |
169 | 168 | this.layout.push(item); |
170 | 169 | }, |
171 | 170 | move: function(i, newX, newY){ |
172 | | - // console.log("MOVE i=" + i + ", X=" + newX + ", Y=" + newY); |
| 171 | + console.log("MOVE i=" + i + ", X=" + newX + ", Y=" + newY); |
173 | 172 | }, |
174 | 173 | resize: function(i, newH, newW, newHPx, newWPx){ |
175 | 174 | console.log("RESIZE i=" + i + ", H=" + newH + ", W=" + newW + ", H(px)=" + newHPx + ", W(px)=" + newWPx); |
|
0 commit comments