Skip to content
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.

Commit

Permalink
homepage re-design: patch by Jan to sort languages per column
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnaber committed Dec 18, 2013
1 parent 740defd commit 7bc97a9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
4 changes: 2 additions & 2 deletions www/css/lib/dropkick/dropkick.css
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ text-shadow:none
}

.dk_options_inner {
max-height:250px;
max-height:300px;
}

.dk_container {
Expand Down Expand Up @@ -142,7 +142,7 @@ display:block
padding: 10px;
}

.dk_options_inner li {
.dk_options_inner .column {
width:23%;
margin: 0px 2% 0px 0px;
float:left
Expand Down
20 changes: 19 additions & 1 deletion www/css/lib/dropkick/jquery.dropkick.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,25 @@
}

$dk = $(template);
$dk.find('.dk_options_inner').html(options.join(''));

function split(a, n) {
var len = a.length, out = [], i = 0;
while (i < len) {
var size = Math.ceil((len - i) / n--);
out.push(a.slice(i, i + size));
i += size;
}
return out;
}

var columns = split(options, 4);

var html = '';
for (var i = 0; i < columns.length; i++) {
var html = html + '<ul class="column">'+columns[i].join('')+'</ul>';
}

$dk.find('.dk_options_inner').html(html);

return $dk;
}
Expand Down

0 comments on commit 7bc97a9

Please sign in to comment.