|
209 | 209 | var _change = _initialWidth - _newWidth;
|
210 | 210 |
|
211 | 211 | if (_initialWidth != _newWidth) {
|
212 |
| - $this.html(''); |
| 212 | + $this.innerHtml = ''; |
213 | 213 | var _settings = data.get($this).lastSettings;
|
214 |
| - _settings.data = data.get($this).data; |
| 214 | + _settings.data = data.get($this).lastSettings.data; |
215 | 215 | _settings.maxWidth = $this.offsetWidth - 1;
|
216 | 216 | flowr($this, _settings);
|
217 | 217 | }
|
|
221 | 221 | // If the responsive var is set to true then listen for resize method
|
222 | 222 | // and prevent resizing from happening twice if responsive is set again during append phase!
|
223 | 223 | if (settings.responsive && !data.get($this).__responsive) {
|
224 |
| - // FIXME |
225 |
| -// $(window).resize(function() { |
226 |
| -// initialWidth = data.get($this).width; |
227 |
| -// newWidth = $this.offsetWidth; |
228 |
| -// |
229 |
| -// //initiate resize |
230 |
| -// if (initialWidth != newWidth) { |
231 |
| -// var task_id = data.get($this).task_id; |
232 |
| -// if (task_id) { |
233 |
| -// task_id = clearTimeout(task_id); |
234 |
| -// task_id = null; |
235 |
| -// } |
236 |
| -// task_id = setTimeout(utils.reorderContent, 80); |
237 |
| -// data.set($this, {task_id: task_id}); |
238 |
| -// } |
239 |
| -// }); |
| 224 | + window.addEventListener('resize', function() { |
| 225 | + initialWidth = data.get($this).width; |
| 226 | + newWidth = $this.offsetWidth; |
| 227 | + |
| 228 | + //initiate resize |
| 229 | + if (initialWidth != newWidth) { |
| 230 | + var task_id = data.get($this).task_id; |
| 231 | + if (task_id) { |
| 232 | + task_id = clearTimeout(task_id); |
| 233 | + task_id = null; |
| 234 | + } |
| 235 | + task_id = setTimeout(utils.reorderContent, 80); |
| 236 | + data.set($this, {task_id: task_id}); |
| 237 | + } |
| 238 | + }); |
240 | 239 | data.set($this, {__responsive: true});
|
241 | 240 | }
|
242 | 241 |
|
|
252 | 251 | for (i = 0; i < _data.length; i++) {
|
253 | 252 | allData.push(_data[i]);
|
254 | 253 | }
|
255 |
| - data.set($this, {_data: allData}); |
| 254 | + data.set($this, {data: allData}); |
256 | 255 |
|
257 | 256 | // While we have a new row
|
258 | 257 | while ((rowData = utils.getNextRow(_data, settings)) != null && rowData.data.length > 0) {
|
|
0 commit comments