mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-26 01:35:28 +03:00
Enable/Disable all button for OSD screen
This commit is contained in:
parent
c233db3fc8
commit
79d5c1a0d0
1 changed files with 12 additions and 1 deletions
13
tabs/osd.js
13
tabs/osd.js
|
@ -1535,7 +1535,18 @@ TABS.osd.initialize = function (callback) {
|
||||||
//Switch all elements
|
//Switch all elements
|
||||||
$('input#switch-all').change(function () {
|
$('input#switch-all').change(function () {
|
||||||
var new_state = $(this).is(':checked');
|
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 () {
|
$(document).on('click', 'span.progressLabel a.save_font', function () {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue