From 3d9985a372cfe3bff657b55d2f9ce34d70f5f4d0 Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Wed, 22 Nov 2017 11:38:05 -0500 Subject: [PATCH] Set counter UI element. Make re-usable for app. --- app/www/index.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/www/index.html b/app/www/index.html index 52e2514..7155b47 100644 --- a/app/www/index.html +++ b/app/www/index.html @@ -381,6 +381,9 @@ elem.value = (parseInt(current) + val); STATE.counter += val; }; + var forceCounter = function (val) { + document.getElementById('counter').value = val; + } var unsetPages = function () { const pages = document.getElementsByClassName('page'); const icons = document.getElementsByClassName('icon'); @@ -573,6 +576,7 @@ }; web.setCounterSuccess = function (res) { STATE.counter = res.counter; + forceCounter(res.counter); console.log(`setCounter to ${res.counter}`); }; web.useJson = function (res) {