From 246696379c539feda5975745262c17ab57f42522 Mon Sep 17 00:00:00 2001 From: Justin Parker Date: Mon, 4 Jul 2022 16:22:54 +1000 Subject: [PATCH] #219 bugfix: meter should not initialise at 100% --- nodel-webui-js/src/nodel.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nodel-webui-js/src/nodel.js b/nodel-webui-js/src/nodel.js index d0d2feb3..9daf87ac 100644 --- a/nodel-webui-js/src/nodel.js +++ b/nodel-webui-js/src/nodel.js @@ -259,6 +259,11 @@ var updatemeter = function(el, val) { var pxheight = $(el).data('pxheight'); if(!pxheight) { var pxheight = $(el).find('.bar').height() / 100; + if (pxheight === 0) { + // The parent or this may be invisible. + // https://stackoverflow.com/questions/9292529/jquery-height-returns-0-on-a-visible-div-why + return; + } $(el).data('pxheight', pxheight); } var width = $(el).data('width');