|
296 | 296 | split($col, $destroyable, $col, targetHeight); |
297 | 297 | } |
298 | 298 |
|
299 | | - while(checkDontEndColumn($col.contents(":last").length && $col.contents(":last").get(0))){ |
| 299 | + while($col.contents(":last").length && checkDontEndColumn($col.contents(":last").get(0))){ |
300 | 300 | var $lastKid = $col.contents(":last"); |
301 | 301 | $lastKid.remove(); |
302 | 302 | $destroyable.prepend($lastKid); |
|
306 | 306 | var div = document.createElement('DIV'); |
307 | 307 | while($destroyable[0].childNodes.length > 0){ |
308 | 308 | var kid = $destroyable[0].childNodes[0]; |
309 | | - for(var i=0;i<kid.attributes.length;i++){ |
310 | | - if(kid.attributes[i].nodeName.indexOf("jQuery") == 0){ |
311 | | - kid.removeAttribute(kid.attributes[i].nodeName); |
| 309 | + if(kid.attributes){ |
| 310 | + for(var i=0;i<kid.attributes.length;i++){ |
| 311 | + if(kid.attributes[i].nodeName.indexOf("jQuery") == 0){ |
| 312 | + kid.removeAttribute(kid.attributes[i].nodeName); |
| 313 | + } |
312 | 314 | } |
313 | 315 | } |
314 | 316 | div.innerHTML = ""; |
|
339 | 341 | // text node. ensure that the text |
340 | 342 | // is not 100% whitespace |
341 | 343 | if(/^\s+$/.test(dom.nodeValue)){ |
342 | | - return true; |
| 344 | + // |
| 345 | + // ok, it's 100% whitespace, |
| 346 | + // so we should return checkDontEndColumn |
| 347 | + // of the inputs previousSibling |
| 348 | + if(!dom.previousSibling) return false; |
| 349 | + return checkDontEndColumn(dom.previousSibling); |
343 | 350 | } |
344 | 351 | return false; |
345 | 352 | } |
|
434 | 441 | // alert("not splitting a dontend"); |
435 | 442 | } |
436 | 443 |
|
437 | | - while(checkDontEndColumn($col.contents(":last").length && $col.contents(":last").get(0))){ |
| 444 | + while($col.contents(":last").length && checkDontEndColumn($col.contents(":last").get(0))){ |
438 | 445 | var $lastKid = $col.contents(":last"); |
439 | 446 | $lastKid.remove(); |
440 | 447 | $destroyable.prepend($lastKid); |
|
0 commit comments