Skip to content

Commit

Permalink
JS : add event to anounce control item color change
Browse files Browse the repository at this point in the history
event is linked to the control item config2 element
event name is : "changePyScadaControlItemColor_" + control_item_id
event.detail is the color formatted as #45bc65
  • Loading branch information
clavay authored and trombastic committed Jul 20, 2023
1 parent 6624257 commit c431225
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pyscada/hmi/static/pyscada/js/pyscada/pyscada_v0-7-0rc14.js
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,10 @@ var store_temp_ajax_data = null;
}else {
e.style.backgroundColor = update_data_colors(control_item_id,val);
}
// create event to announce color change for a control item
elem = document.querySelector("div.hidden.controlitem-config2[data-id='" + control_item_id.split('-')[1] + "']");
var event = new CustomEvent("changePyScadaControlItemColor_" + control_item_id.split('-')[1], { detail: update_data_colors(control_item_id,val) });
elem.dispatchEvent(event);
}
})

Expand Down

0 comments on commit c431225

Please sign in to comment.