Skip to content

Commit 9f6fc3f

Browse files
committed
added test for columnbreak that's not nested
1 parent ad77a44 commit 9f6fc3f

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

samples/sample13.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ <h1>Soleat civibus in pri</h1>
5656
<h1>Lorem ipsum ne justo</h1>
5757
<p>Bonorum has. His ut cibo quas tantas, vis ut probo adhuc definiebas, has at meis debet vulputate. No sed velit essent suavitate, in pro decore <a href='javascript:;'>ceteros temporibus</a>, usu in odio offendit theophrastus. Mel labore indoctum cu, ad soleat admodum delicatissimi sed, mei viris tritani ullamcorper eu. Ut vim simul aperiam.</p>
5858
<p>Eu eleifend repudiandae has. Mea eu ridens aliquam. <img src='painting1.jpg'> Nisl aeque sit ut, posse dolor utinam cum in. Ad timeam sapientem eos, et eripuit inermis nam. Eos integre voluptaria ne, iriure concludaturque ut eum.</p>
59-
<p><span class='columnbreak'></span></p>
59+
<span class='columnbreak'></span>
6060
<p>Vis erant intellegat in. Soleat legere no ius, usu ex laoreet molestie. Sit <a href='javascript:;'>eu sint inermis</a>. Ea zzril scribentur pro.</p>
6161
<h1>Tempor essent appetere</h1>
6262
<p>Ius mutat commune expetendis in. Nam et quas sensibus <a href='javascript:;'>reprimique</a>, vix no erat soluta suavitate. At mel eius dictas latine. Corrumpit inciderint reformidans sed no, no usu omnis utinam noluisse.</p>

src/jquery.columnizer.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,14 @@
126126
//
127127
// Because we're not cloning, jquery will actually move the element"
128128
// http://welcome.totheinter.net/2009/03/19/the-undocumented-life-of-jquerys-append/
129-
if($(node).andSelf().find(".columnbreak").length){
129+
if($(node).find(".columnbreak").length){
130+
//
131+
// our column is on a column break, so just end here
132+
return;
133+
}
134+
if($(node).hasClass("columnbreak")){
135+
//
136+
// our column is on a column break, so just end here
130137
return;
131138
}
132139
$putInHere.append(node);
@@ -192,7 +199,12 @@
192199
* two copies of the element with it's contents divided between each
193200
*/
194201
function split($putInHere, $pullOutHere, $parentColumn, targetHeight){
195-
if($putInHere.contents(":last").andSelf().find(".columnbreak").length){
202+
if($putInHere.contents(":last").find(".columnbreak").length){
203+
//
204+
// our column is on a column break, so just end here
205+
return;
206+
}
207+
if($putInHere.contents(":last").hasClass("columnbreak")){
196208
//
197209
// our column is on a column break, so just end here
198210
return;

0 commit comments

Comments
 (0)