diff --git a/src/main/webapp/js/store/talks.js b/src/main/webapp/js/store/talks.js index 7eb2b3c..8d03a28 100644 --- a/src/main/webapp/js/store/talks.js +++ b/src/main/webapp/js/store/talks.js @@ -24,6 +24,7 @@ define(['store', 'computed', 'request', 'popups', 'dataHelper', 'scrollHelper'], return false; } console.log (occupied + "/" + available + "=" + (occupied / available)); + console.log ("true or false? " + (occupied / available >= threshold)); return occupied / available >= threshold; } @@ -81,7 +82,6 @@ define(['store', 'computed', 'request', 'popups', 'dataHelper', 'scrollHelper'], function confirmAndToggleFull(event) { var id = event.currentTarget.getAttribute("data-id"); - console.log("id=" + id); var theTalk = computed.talks()[id]; if (!store.loggedIn) { popups.alert("Please Log In", "You must be logged in to do this."); @@ -91,7 +91,9 @@ define(['store', 'computed', 'request', 'popups', 'dataHelper', 'scrollHelper'], return; } - confirmAndUpdate(theTalk, (theTalk.fullyBooked ? theTalk.availableSeats : 0)); + var newValueForSeats = theTalk.fullyBooked ? theTalk.availableSeats : 0; + document.querySelector("input[data-id='" + id +"']").value = newValueForSeats; + confirmAndUpdate(theTalk, newValueForSeats); } function loadTalks() { diff --git a/src/main/webapp/js/utils/request.js b/src/main/webapp/js/utils/request.js index 0d7b908..f3673f2 100644 --- a/src/main/webapp/js/utils/request.js +++ b/src/main/webapp/js/utils/request.js @@ -28,6 +28,7 @@ define(['dataHelper'], function (helper) { if (headers) { var key, headerKeys = Object.keys(headers); for (key in headerKeys) { + console.log("set request header " + headerKeys[key] + " to " + headers[headerKeys[key]]); xhttp.setRequestHeader(headerKeys[key], headers[headerKeys[key]]); } }