Skip to content

Commit

Permalink
speed up OSD tab loading if there are too many custom OSD elements.
Browse files Browse the repository at this point in the history
  • Loading branch information
error414 committed Oct 16, 2024
1 parent ae0f6a8 commit 4546a73
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tabs/osd.js
Original file line number Diff line number Diff line change
Expand Up @@ -3549,6 +3549,7 @@ function createCustomElements(){
}

var customElementsContainer = $('#osdCustomElements');
var init = true;

for(var i = 0; i < FC.OSD_CUSTOM_ELEMENTS.settings.customElementsCount; i++){
var label = $('<label>');
Expand Down Expand Up @@ -3606,7 +3607,9 @@ function createCustomElements(){
var valueBlock = $('.' + $(this).data('valueCellClass'))
valueBlock.find('.value').hide();
valueBlock.find('.' + dataValue).show();
updateOSDCustomElementsDisplay();
if(!init){
updateOSDCustomElementsDisplay();
}
});
}

Expand Down Expand Up @@ -3636,6 +3639,7 @@ function createCustomElements(){

fillCustomElementsValues();
customElementsInitCallback();
init = false;
}

function updateOSDCustomElementsDisplay() {
Expand Down Expand Up @@ -4079,4 +4083,4 @@ TABS.osd.cleanup = function (callback) {
$('.jBox-wrapper').remove();

if (callback) callback();
};
};

0 comments on commit 4546a73

Please sign in to comment.