@@ -160,31 +160,44 @@ export class BeaconsMinionPanel extends Panel {
160160 this . _addMenuItemBeaconsEnableBeaconWhenNeeded ( beaconMenu , pMinionId , beaconName , beacon ) ;
161161 this . _addMenuItemBeaconsDelete ( beaconMenu , pMinionId , beaconName ) ;
162162
163- // menu comes before this data on purpose
164- const beaconConfig = Output . formatObject ( beacon ) ;
165- const beaconConfigTd = Utils . createTd ( "beacon-config" , beaconConfig ) ;
166- let initialTimestamp = "(waiting)" ;
167- let initialValue = "(waiting)" ;
163+ const beaconConfigTd = Utils . createTd ( ) ;
164+ Output . setHighlightObject ( beaconConfigTd , beacon , "pre" ) ;
165+ tr . appendChild ( beaconConfigTd ) ;
166+
167+ let initialTimestamp ;
168+ let initialValue ;
169+ let initialClass ;
168170 if ( beacon . enabled === false ) {
169- beaconConfigTd . classList . add ( "beacon-disabled" ) ;
171+ initialClass = "beacon-disabled" ;
170172 initialTimestamp = Character . EM_DASH ;
171173 initialValue = "(beacon" + Character . NO_BREAK_SPACE + "disabled)" ;
172174 } else if ( beacons . enabled === false ) {
173- beaconConfigTd . classList . add ( "beacon-disabled" ) ;
175+ initialClass = "beacon-disabled" ;
174176 initialTimestamp = Character . EM_DASH ;
175177 initialValue = "(beacons" + Character . NO_BREAK_SPACE + "disabled)" ;
178+ } else {
179+ initialClass = "beacon-waiting" ;
180+ initialTimestamp = "(waiting)" ;
181+ initialValue = "(waiting)" ;
176182 }
177- tr . appendChild ( beaconConfigTd ) ;
178183
179184 const beaconTimestampTd = Utils . createTd ( ) ;
180- const beaconTimestampSpan = Utils . createSpan ( [ "beacon-timestamp" , "beacon-waiting" ] , initialTimestamp ) ;
185+ const beaconTimestampSpan = Utils . createSpan ( [ "beacon-timestamp" , initialClass ] , initialTimestamp ) ;
181186 beaconTimestampTd . appendChild ( beaconTimestampSpan ) ;
182187 tr . appendChild ( beaconTimestampTd ) ;
183188 tr . beaconTimestampSpan = beaconTimestampSpan ;
184189
185- const beaconValueTd = Utils . createTd ( [ "beacon-value" , "beacon-waiting" ] , initialValue ) ;
190+ const beaconValueTd = Utils . createTd ( ) ;
191+ const beaconValueLabelDiv = Utils . createDiv ( ) ;
192+ beaconValueLabelDiv . style . display = "none" ;
193+ beaconValueTd . appendChild ( beaconValueLabelDiv ) ;
194+ const beaconValueValueDiv = Utils . createDiv ( ) ;
195+ beaconValueValueDiv . innerText = initialValue ;
196+ beaconValueValueDiv . classList . add ( "beacon-value" , initialClass ) ;
197+ beaconValueTd . appendChild ( beaconValueValueDiv ) ;
186198 tr . appendChild ( beaconValueTd ) ;
187- tr . beaconValueTd = beaconValueTd ;
199+ tr . beaconValueLabelDiv = beaconValueLabelDiv ;
200+ tr . beaconValueValueDiv = beaconValueValueDiv ;
188201
189202 const tbody = this . table . tBodies [ 0 ] ;
190203 tbody . appendChild ( tr ) ;
@@ -309,7 +322,6 @@ export class BeaconsMinionPanel extends Panel {
309322 return ;
310323 }
311324
312- let value = "" ;
313325 let stamp = "" ;
314326 if ( pData [ "_stamp" ] ) {
315327 // keep timestamp for further logic
@@ -321,13 +333,13 @@ export class BeaconsMinionPanel extends Panel {
321333
322334 if ( pTag !== prefix + beaconName + "/" ) {
323335 // Show the tag when it has extra information
324- value = pTag + "\n" ;
336+ tr . beaconValueLabelDiv . style . display = "" ;
337+ tr . beaconValueLabelDiv . innerText = pTag ;
325338 }
326339 if ( pData [ "id" ] === minionId ) {
327340 delete pData [ "id" ] ;
328341 }
329- value += Output . formatObject ( pData ) ;
330- tr . beaconValueTd . classList . remove ( "beacon-waiting" ) ;
342+ tr . beaconValueValueDiv . classList . remove ( "beacon-waiting" ) ;
331343
332344 // round down to 0.1 second
333345 // secondary events are close, but rarely exact on the same time
@@ -366,7 +378,7 @@ export class BeaconsMinionPanel extends Panel {
366378 tr . helpButtonSpan . style . display = "none" ;
367379 }
368380
369- tr . beaconValueTd . innerText = value ;
381+ Output . setHighlightObject ( tr . beaconValueValueDiv , pData , "pre" ) ;
370382
371383 tr . prevStamp = stamp ;
372384 tr . prevTag = pTag ;
0 commit comments