Button colours and animations not working

I have this on a few machines.

I press a button to allow ONE message to pass.

I press the button and I get a spinning icon.

(See picture.)

This is the code:

[{"id":"5730058.37277fc","type":"function","z":"aa48e352.9ad2f8","name":"One only.","func":"if (msg.topic == \"GATE\")\n{\n    context.set(\"ALLOW\",1);\n    node.status({fill: \"green\",text:\"ONE\"});\n    return;\n}\nif (context.get(\"ALLOW\") == 1)\n{\n    //\n    context.set(\"ALLOW\",0);\n    node.status({});\n    return msg;\n}","outputs":1,"noerr":0,"x":1040,"y":640,"wires":[["f07989c9.0bbec8","20e1ab25.801e34"]]},{"id":"9e939478.0450f8","type":"ui_button","z":"aa48e352.9ad2f8","name":"One only","group":"bac7ba06.8fc4","order":8,"width":"1","height":"1","passthru":false,"label":"{{msg.icon}}","tooltip":"","color":"black","bgcolor":"{{msg.colour}}","icon":"","payload":"open","payloadType":"str","topic":"GATE","x":1040,"y":680,"wires":[["5730058.37277fc","7820a2ec.4b053c"]]},{"id":"20e1ab25.801e34","type":"change","z":"aa48e352.9ad2f8","name":"done","rules":[{"t":"set","p":"colour","pt":"msg","to":"maroon","tot":"str"},{"t":"set","p":"icon","pt":"msg","to":"<i class=\"material-icons\"> repeat_one </i>","tot":"str"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1200,"y":680,"wires":[["9e939478.0450f8"]]},{"id":"7820a2ec.4b053c","type":"change","z":"aa48e352.9ad2f8","name":"pressed","rules":[{"t":"set","p":"colour","pt":"msg","to":"white","tot":"str"},{"t":"set","p":"icon","pt":"msg","to":"<i class=\"fa fa-refresh fa-spin fa-2x\"></i>","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":720,"wires":[["9e939478.0450f8"]]},{"id":"bac7ba06.8fc4","type":"ui_group","name":"BedPi Machine health","tab":"50f4e688.7d4b7","order":1,"disp":true,"width":"9","collapse":false},{"id":"50f4e688.7d4b7","type":"ui_tab","name":"Machine health","icon":"fa-heartbeat","order":6,"disabled":false,"hidden":false}]

When a message passes, it stops spinning and puts another icon there.

On another machine I get a white box.

But if I change the code to make the background green it works, but the icons is WHITE - where as in the example shown, it is back.

Here is the code form the second machine where it is not visible as the icon is white.

[{"id":"2c6e094d.c2dff6","type":"ui_button","z":"d29f28a7.551f88","name":"One only","group":"7882112d.e71858","order":8,"width":"1","height":"1","passthru":false,"label":"{{msg.icon}}","tooltip":"","color":"black","bgcolor":"{{msg.colour}}","icon":"","payload":"open","payloadType":"str","topic":"GATE","x":780,"y":680,"wires":[["b3a50616.fd7af8"]]},{"id":"3693a078.0f79e8","type":"change","z":"d29f28a7.551f88","name":"done","rules":[{"t":"set","p":"colour","pt":"msg","to":"maroon","tot":"str"},{"t":"set","p":"icon","pt":"msg","to":"<i class=\"material-icons\"> repeat_one </i>","tot":"str"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":940,"y":680,"wires":[["2c6e094d.c2dff6"]]},{"id":"b3a50616.fd7af8","type":"change","z":"d29f28a7.551f88","name":"pressed","rules":[{"t":"set","p":"colour","pt":"msg","to":"green","tot":"str"},{"t":"set","p":"icon","pt":"msg","to":"<i class=\"fa fa-refresh fa-spin fa-2x\"></i>","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":720,"wires":[["2c6e094d.c2dff6"]]},{"id":"7882112d.e71858","type":"ui_group","name":"TelePi Machine health","tab":"11d11c61.3403dc","order":1,"disp":true,"width":"9","collapse":false},{"id":"11d11c61.3403dc","type":"ui_tab","name":"Machine health","icon":"fa-heartbeat","order":5,"disabled":false,"hidden":false}]

What am I missing?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.