@@ -164,31 +164,44 @@ export class BeaconsMinionPanel extends Panel {
164164 this . _addMenuItemBeaconsEnableBeaconWhenNeeded ( beaconMenu , pMinionId , beaconName , beacon ) ;
165165 this . _addMenuItemBeaconsDelete ( beaconMenu , pMinionId , beaconName ) ;
166166
167- // menu comes before this data on purpose
168- const beaconConfig = Output . formatObject ( beacon ) ;
169- const beaconConfigTd = Utils . createTd ( "beacon-config" , beaconConfig ) ;
170- let initialTimestamp = "(waiting)" ;
171- let initialValue = "(waiting)" ;
167+ const beaconConfigTd = Utils . createTd ( ) ;
168+ Output . setHighlightObject ( beaconConfigTd , beacon , "pre" ) ;
169+ tr . appendChild ( beaconConfigTd ) ;
170+
171+ let initialTimestamp ;
172+ let initialValue ;
173+ let initialClass ;
172174 if ( beacon . enabled === false ) {
173- beaconConfigTd . classList . add ( "beacon-disabled" ) ;
175+ initialClass = "beacon-disabled" ;
174176 initialTimestamp = Character . EM_DASH ;
175177 initialValue = "(beacon" + Character . NO_BREAK_SPACE + "disabled)" ;
176178 } else if ( beacons . enabled === false ) {
177- beaconConfigTd . classList . add ( "beacon-disabled" ) ;
179+ initialClass = "beacon-disabled" ;
178180 initialTimestamp = Character . EM_DASH ;
179181 initialValue = "(beacons" + Character . NO_BREAK_SPACE + "disabled)" ;
182+ } else {
183+ initialClass = "beacon-waiting" ;
184+ initialTimestamp = "(waiting)" ;
185+ initialValue = "(waiting)" ;
180186 }
181- tr . appendChild ( beaconConfigTd ) ;
182187
183188 const beaconTimestampTd = Utils . createTd ( ) ;
184- const beaconTimestampSpan = Utils . createSpan ( [ "beacon-timestamp" , "beacon-waiting" ] , initialTimestamp ) ;
189+ const beaconTimestampSpan = Utils . createSpan ( [ "beacon-timestamp" , initialClass ] , initialTimestamp ) ;
185190 beaconTimestampTd . appendChild ( beaconTimestampSpan ) ;
186191 tr . appendChild ( beaconTimestampTd ) ;
187192 tr . beaconTimestampSpan = beaconTimestampSpan ;
188193
189- const beaconValueTd = Utils . createTd ( [ "beacon-value" , "beacon-waiting" ] , initialValue ) ;
194+ const beaconValueTd = Utils . createTd ( ) ;
195+ const beaconValueLabelDiv = Utils . createDiv ( ) ;
196+ beaconValueLabelDiv . style . display = "none" ;
197+ beaconValueTd . appendChild ( beaconValueLabelDiv ) ;
198+ const beaconValueValueDiv = Utils . createDiv ( ) ;
199+ beaconValueValueDiv . innerText = initialValue ;
200+ beaconValueValueDiv . classList . add ( "beacon-value" , initialClass ) ;
201+ beaconValueTd . appendChild ( beaconValueValueDiv ) ;
190202 tr . appendChild ( beaconValueTd ) ;
191- tr . beaconValueTd = beaconValueTd ;
203+ tr . beaconValueLabelDiv = beaconValueLabelDiv ;
204+ tr . beaconValueValueDiv = beaconValueValueDiv ;
192205
193206 const tbody = this . table . tBodies [ 0 ] ;
194207 tbody . appendChild ( tr ) ;
@@ -313,7 +326,6 @@ export class BeaconsMinionPanel extends Panel {
313326 return ;
314327 }
315328
316- let value = "" ;
317329 let stamp = "" ;
318330 if ( pData [ "_stamp" ] ) {
319331 // keep timestamp for further logic
@@ -325,13 +337,13 @@ export class BeaconsMinionPanel extends Panel {
325337
326338 if ( pTag !== prefix + beaconName + "/" ) {
327339 // Show the tag when it has extra information
328- value = pTag + "\n" ;
340+ tr . beaconValueLabelDiv . style . display = "" ;
341+ tr . beaconValueLabelDiv . innerText = pTag ;
329342 }
330343 if ( pData [ "id" ] === minionId ) {
331344 delete pData [ "id" ] ;
332345 }
333- value += Output . formatObject ( pData ) ;
334- tr . beaconValueTd . classList . remove ( "beacon-waiting" ) ;
346+ tr . beaconValueValueDiv . classList . remove ( "beacon-waiting" ) ;
335347
336348 // round down to 0.1 second
337349 // secondary events are close, but rarely exact on the same time
@@ -370,7 +382,7 @@ export class BeaconsMinionPanel extends Panel {
370382 tr . helpButtonSpan . style . display = "none" ;
371383 }
372384
373- tr . beaconValueTd . innerText = value ;
385+ Output . setHighlightObject ( tr . beaconValueValueDiv , pData , "pre" ) ;
374386
375387 tr . prevStamp = stamp ;
376388 tr . prevTag = pTag ;
0 commit comments