From 45dcb441b0c0699e2db426a89824b426cf1d8e31 Mon Sep 17 00:00:00 2001 From: Peter Finlayson Date: Fri, 19 Jul 2019 12:45:26 +0200 Subject: [PATCH] pre-populate the untagged types (fixes #1869) --- .../static/webclient/js/plugins/goldenlayout.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/evennia/web/webclient/static/webclient/js/plugins/goldenlayout.js b/evennia/web/webclient/static/webclient/js/plugins/goldenlayout.js index b6ca4d8f0a..917d075ed3 100644 --- a/evennia/web/webclient/static/webclient/js/plugins/goldenlayout.js +++ b/evennia/web/webclient/static/webclient/js/plugins/goldenlayout.js @@ -53,7 +53,11 @@ let goldenlayout = (function () { $(".content").each( function () { let types = $(this).attr("types"); if ( typeof types !== "undefined" ) { - untagged = filter( types.split(" "), untagged ); + let typesArray = types.split(" "); + // add our types to known types so that the onText function don't add them to untagged later + knownTypes = Array.from(new Set([...knownTypes, ...typesArray])); + // remove our types from the untagged array + untagged = filter( typesArray, untagged ); } }); } @@ -447,6 +451,9 @@ let goldenlayout = (function () { // finish the setup and actually start GoldenLayout myLayout.init(); + // work out which types are untagged based on our pre-configured layout + calculateUntaggedTypes(); + // Set the Event handler for when the client window changes size $(window).bind("resize", scrollAll);