|
35 | 35 | // column widths, but will take slightly longer |
36 | 36 | accuracy : false, |
37 | 37 | // don't automatically layout columns, only use manual columnbreak |
38 | | - manualbreaks : false |
| 38 | + manualBreaks : false |
39 | 39 | }; |
40 | 40 | var options = $.extend(defaults, options); |
41 | 41 |
|
|
52 | 52 | var $cache = $('<div></div>'); // this is where we'll put the real content |
53 | 53 | var lastWidth = 0; |
54 | 54 | var columnizing = false; |
55 | | - var manualbreaks = options.manualbreaks; |
| 55 | + var manualBreaks = options.manualBreaks; |
56 | 56 |
|
57 | 57 | var adjustment = 0; |
58 | 58 |
|
|
120 | 120 | // |
121 | 121 | // add as many nodes to the column as we can, |
122 | 122 | // but stop once our height is too tall |
123 | | - while((manualbreaks || $parentColumn.height() < targetHeight) && |
| 123 | + while((manualBreaks || $parentColumn.height() < targetHeight) && |
124 | 124 | $pullOutHere[0].childNodes.length){ |
125 | 125 | var node = $pullOutHere[0].childNodes[0] |
126 | 126 | // |
|
227 | 227 | // the column and exit |
228 | 228 | $putInHere.append($clone); |
229 | 229 | $cloneMe.remove(); |
230 | | - }else if (manualbreaks){ |
| 230 | + }else if (manualBreaks){ |
231 | 231 | // keep adding until we hit a manual break |
232 | 232 | $putInHere.append($clone); |
233 | 233 | $cloneMe.remove(); |
|
358 | 358 | lastWidth = $inBox.width(); |
359 | 359 |
|
360 | 360 | var numCols = Math.round($inBox.width() / options.width); |
| 361 | + var optionWidth = options.width; |
| 362 | + var optionHeight = options.height; |
361 | 363 | if(options.columns) numCols = options.columns; |
362 | | - if(manualbreaks){ |
| 364 | + if(manualBreaks){ |
363 | 365 | numCols = $cache.find(".columnbreak").length + 1; |
| 366 | + optionWidth = false; |
| 367 | + |
364 | 368 | } |
365 | 369 | // if ($inBox.data("columnized") && numCols == $inBox.children().length) { |
366 | 370 | // return; |
|
386 | 390 | if(options.overflow){ |
387 | 391 | maxLoops = 1; |
388 | 392 | targetHeight = options.overflow.height; |
389 | | - }else if(options.height && options.width){ |
| 393 | + }else if(optionHeight && optionWidth){ |
390 | 394 | maxLoops = 1; |
391 | | - targetHeight = options.height; |
| 395 | + targetHeight = optionHeight; |
392 | 396 | scrollHorizontally = true; |
393 | 397 | } |
394 | 398 |
|
|
538 | 542 | // it's scrolling horizontally, fix the width/classes of the columns |
539 | 543 | $inBox.children().each(function(i){ |
540 | 544 | $col = $inBox.children().eq(i); |
541 | | - $col.width(options.width + "px"); |
| 545 | + $col.width(optionWidth + "px"); |
542 | 546 | if(i==0){ |
543 | 547 | $col.addClass("first"); |
544 | 548 | }else if(i==$inBox.children().length-1){ |
|
548 | 552 | $col.removeClass("last"); |
549 | 553 | } |
550 | 554 | }); |
551 | | - $inBox.width($inBox.children().length * options.width + "px"); |
| 555 | + $inBox.width($inBox.children().length * optionWidth + "px"); |
552 | 556 | } |
553 | 557 | $inBox.append($("<br style='clear:both;'>")); |
554 | 558 | } |
|
0 commit comments