Skip to content

Commit 79d5c1a

Browse files
committed
Enable/Disable all button for OSD screen
1 parent c233db3 commit 79d5c1a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tabs/osd.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1535,7 +1535,18 @@ TABS.osd.initialize = function (callback) {
15351535
//Switch all elements
15361536
$('input#switch-all').change(function () {
15371537
var new_state = $(this).is(':checked');
1538-
$('#element-fields input[type=checkbox]').prop('checked', new_state).change();
1538+
1539+
var updateList = [];
1540+
$('#element-fields input[type=checkbox]').each(function () {
1541+
var field = $(this).data('field');
1542+
field.isVisible = new_state;
1543+
1544+
updateList.push(MSP.promise(MSPCodes.MSP_SET_OSD_CONFIG, OSD.msp.encodeLayout(field)));
1545+
})
1546+
1547+
Promise.all(updateList).then(function () {
1548+
updateOsdView();
1549+
});
15391550
})
15401551

15411552
$(document).on('click', 'span.progressLabel a.save_font', function () {

0 commit comments

Comments
 (0)