Shuffle splashpage highlights
(cherry picked from commit 1101c3c9497766a498422ce5c5bfe797a52cf840)
This commit is contained in:
parent
60847e1dae
commit
988803b601
2 changed files with 14 additions and 1 deletions
|
|
@ -31,6 +31,19 @@ $(function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Randomize order of parallel elements by shuffling the decks
|
||||||
|
* Adapted from https://stackoverflow.com/questions/7070054
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(document).ready( function() {
|
||||||
|
$.each($(".shuffle-deck"), function(index, deck) {
|
||||||
|
for(var i = deck.children.length; i >= 0; i--) {
|
||||||
|
deck.appendChild(deck.children[Math.random() * i | 0]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
$(".select-help-toggle").change(function () {
|
$(".select-help-toggle").change(function () {
|
||||||
var id = $(this).attr('id');
|
var id = $(this).attr('id');
|
||||||
$('.' + id).collapse('hide');
|
$('.' + id).collapse('hide');
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
Program Highlights
|
Program Highlights
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
.row.row-centered
|
.row.row-centered.shuffle-deck
|
||||||
- highlights.each do |event|
|
- highlights.each do |event|
|
||||||
- speaker = event.speakers_ordered.first
|
- speaker = event.speakers_ordered.first
|
||||||
.col-md-3.col-sm-3.col-centered.col-top.highlights
|
.col-md-3.col-sm-3.col-centered.col-top.highlights
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue