From 0932319d745f550968b5dec24e80d0acd5ffb768 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 22 Dec 2014 12:49:53 +0900 Subject: Four grade 6 classes next year, so thanks to bootstrap's limit of 12 columns per row, must split classes display into two rows --- index.html | 6 ++---- js/main.js | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index ab9d899..3a48244 100644 --- a/index.html +++ b/index.html @@ -96,10 +96,8 @@
-
- - -
+
+

diff --git a/js/main.js b/js/main.js index f0fb3d8..dfef356 100644 --- a/js/main.js +++ b/js/main.js @@ -63,8 +63,10 @@ function updateClasses () // first update the HTML displayed classes.sortClasses(); - $classes = $('#classes'); - $classes.html(""); + $classes1 = $('#classes-1'); + $classes1.html(""); + $classes2 = $('#classes-2'); + $classes2.html(""); function appendClassHTML (clas, index, array) { @@ -73,6 +75,9 @@ function updateClasses () // background colour should be green for two classes with the highest points (and our array is sorted by points) var colour = index < 2 ? ' style="background-color: lightgreen;"' : ''; + // column width + var width = index < 3 ? 4 : 3 + // time var minutes = '' + Math.floor(clas.time / 60); var seconds = '' + (clas.time - minutes * 60); @@ -81,7 +86,8 @@ function updateClasses () // build and append HTML - var html = '
' + // var html = '
' + var html = '
' + '

' + clas.id + '

' + '

' + '' + clas.points + ' points' @@ -94,7 +100,10 @@ function updateClasses () + '

' + '
'; - $classes.append(html); + if (index < 3) + $classes1.append(html); + else + $classes2.append(html); } classes.forEach(appendClassHTML); -- cgit v1.2.3