From ee8795110d534f371dab357229b843d913db6bf9 Mon Sep 17 00:00:00 2001 From: Matt Bernhardt Date: Tue, 3 Feb 2015 15:08:20 -0500 Subject: [PATCH] Switching hours harvester over to 1.1 code developed by Solh (the loadHoursSingle function now builds the entire grid, but only once, rather than multiple calls) Signed-off-by: Matt Bernhardt --- js/hours-lookup.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/js/hours-lookup.js b/js/hours-lookup.js index d093650f..e4a62927 100644 --- a/js/hours-lookup.js +++ b/js/hours-lookup.js @@ -108,14 +108,19 @@ function loadHoursSingle(data, tabletop) { location, singleHoursObject; + // Start by loading the complete hours object for the given date + var completeHoursObject = buildCompleteHoursObject(data, date); + jQuery("[data-location-hours]").each(function() { + // Read the relevant location location = jQuery(this).data("location-hours"); - // perform any last minute re-formatting - singleHoursObject = buildSingleHoursObject(data,date,location) + // Perform any last-minute formatting + singleHoursObject = getSingleHoursObject(completeHoursObject,date,location) .replace(/:00/g,""); + // Write out to the page jQuery(this).html(singleHoursObject); });