In order to add logic into our button node, we will add an inject node, a function node, and two change nodes. This will allow us to change the color and the icon of the button when pressed.
Next, double-click on the function parameter, type the following code and parameters
1
var state = context.state || false;
2
state = !state;
3
context.state = state;
4
if (state) { return [msg,null]; }
5
else { return [null,msg]; }
6
​
Copied!
Click Done once completed
Next, double-click on the top change (1) node and change the following parameters
1
<i class="fa fa-rotate-90 fa-folder-open-o"></i> OPENED FEEDER
Copied!
Click Done once completed
Next, double-click on the top change (2) node and change the following parameters