I'm writing a small plugin that adds some buttons to OctoPrint navbar.
So far it works.
My problem: if one of this buttons is clicked, the focus jumps to Webcam area.
How can I make the focus stay at navbar after clicking one of this buttons?
Code is just a small _init_.py
and a jinja2 template.
The template:
<a href="#" style="padding: 0px 5px 0px 5px">
<button id="electric2on" class="btn" onclick='OctoPrint.simpleApiCommand("PrnBaseStatus", "LEOONOFF", {"REQ_CGRU_LABEL":1,"REQ_CVAL_LABEL":1})' style="height: 32px; text-align:center;" title="Strom: OFF
Click to switch" >
<span class="fa-stack" style="font-size: 11px" >
<i class="fa fa-ban fa-stack-2x" style="color:red;"></i>
<i class="fas fa-plug fa-stack-1x"></i>
</span>
</button>
<button id="electric2off" class="btn" onclick='OctoPrint.simpleApiCommand("PrnBaseStatus", "LEOONOFF", {"REQ_CGRU_LABEL":1,"REQ_CVAL_LABEL":0})' style="height: 32px; text-align:middle;" title="Strom: ON
Click to switch">
<span class="fa-stack" style="font-size: 11px" >
<i class="far fa-circle fa-stack-2x" style="color:green;"></i>
<i class="fas fa-plug fa-stack-1x" style="color:green;"></i>
</span>
</button>
<button id="printer2on" class="btn" onclick='OctoPrint.simpleApiCommand("PrnBaseStatus", "LEOONOFF", {"REQ_CGRU_LABEL":2,"REQ_CVAL_LABEL":1})' style="height: 32px; text-align:top;" title="Drucker: OFF
Click to switch">
<span class="fa-stack" style="font-size: 11px">
<i class="fa fa-ban fa-stack-2x" style="color:red;"></i>
<i class="fas fa-print fa-stack-1x"></i>
</span>
</button>
<button id="printer2off" class="btn" onclick='OctoPrint.simpleApiCommand("PrnBaseStatus", "LEOONOFF", {"REQ_CGRU_LABEL":2,"REQ_CVAL_LABEL":0})' style="height: 32px; text-align:center;" title="Drucker: ON
Click to switch">
<span class="fa-stack" style="font-size: 11px">
<i class="far fa-circle fa-stack-2x" style="color:green;"></i>
<i class="fas fa-print fa-stack-1x" style="color:green;"></i>
</span>
</button>
</a>