1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-24 16:55:24 +03:00

Enable/Disable all button for OSD screen

This commit is contained in:
Volodymyr Moskalyk 2017-10-15 11:12:26 +02:00
parent c233db3fc8
commit 79d5c1a0d0

View file

@ -1535,7 +1535,18 @@ TABS.osd.initialize = function (callback) {
//Switch all elements
$('input#switch-all').change(function () {
var new_state = $(this).is(':checked');
$('#element-fields input[type=checkbox]').prop('checked', new_state).change();
var updateList = [];
$('#element-fields input[type=checkbox]').each(function () {
var field = $(this).data('field');
field.isVisible = new_state;
updateList.push(MSP.promise(MSPCodes.MSP_SET_OSD_CONFIG, OSD.msp.encodeLayout(field)));
})
Promise.all(updateList).then(function () {
updateOsdView();
});
})
$(document).on('click', 'span.progressLabel a.save_font', function () {