From 1bd79c55037ce6da750722f3ba463b129da26ae7 Mon Sep 17 00:00:00 2001 From: Joseph Malloch Date: Wed, 11 Sep 2024 22:39:32 -0300 Subject: [PATCH] Fixed scrollbar ugliness and hide local device and signals. --- css/style_dark.css | 2 +- js/Graph.js | 6 +++++- webmapper.py | 8 +++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/css/style_dark.css b/css/style_dark.css index 5ad58b3..498272e 100644 --- a/css/style_dark.css +++ b/css/style_dark.css @@ -84,7 +84,7 @@ thead, #networkMenu { position: relative; /* overflow: auto;*/ overflow-x: hidden; - overflow-y: scroll; + overflow-y: auto; } /* tertiary highlight selection */ diff --git a/js/Graph.js b/js/Graph.js index df70833..c7b7534 100644 --- a/js/Graph.js +++ b/js/Graph.js @@ -182,7 +182,11 @@ NodeArray.prototype = { }, find : function(key) { - return this.contents[key]; + if (key in this.contents) + return this.contents[key]; + else + console.log('no item matching key:', key); + return null; } }; diff --git a/webmapper.py b/webmapper.py index 5cbff56..68bae4f 100644 --- a/webmapper.py +++ b/webmapper.py @@ -172,6 +172,8 @@ def map_props(map): def on_device(type, dev, event): # print('ON_DEVICE:', event, dev) + if dev['is_local']: + return dev = dev_props(dev) if event == mpr.Graph.Event.NEW or event == mpr.Graph.Event.MODIFIED: new_devs[dev['key']] = dev @@ -181,6 +183,8 @@ def on_device(type, dev, event): def on_signal(type, sig, event): # print('ON_SIGNAL:', event) + if sig['is_local']: + return sig = sig_props(sig) if event == mpr.Graph.Event.NEW or event == mpr.Graph.Event.MODIFIED: new_sigs[sig['key']] = sig @@ -188,7 +192,9 @@ def on_signal(type, sig, event): del_sigs[sig['key']] = sig def on_map(type, map, event): -# print('ON_MAP:', event) +# print('ON_MAP:', event, type, map) + if map['is_local']: + return map = map_props(map) if event == mpr.Graph.Event.NEW or event == mpr.Graph.Event.MODIFIED: new_maps[map['key']] = map