15.02.2021, 11:38
Use an object that is not connected to any control so the its value is always 0. Change widget-5 to your widget element ID, additional class for the opening element is widget-opener, change icon paths as needed.
Code:
$(function(){
var widget = $('#widget-5');
var img = $('.widget-opener').find('img');
var icon_on = '/scada/resources/icons/ok-active.svg';
var icon_off = '/scada/resources/icons/ok.svg';
widget
.on('widget-show', function() { img.attr('src', icon_on); })
.on('widget-hide', function() { img.attr('src', icon_off); });
});