Embed input elements into labels.

This commit is contained in:
kovacsv 2021-09-07 15:04:45 +02:00
parent 419e8775dd
commit e7af727fa9
2 changed files with 6 additions and 4 deletions

View File

@ -136,8 +136,9 @@ OV.ExportDialog = class
for (let i = 0; i < exportFormat.formats.length; i++) {
let format = exportFormat.formats[i];
let formatDiv = $('<div>').addClass ('ov_dialog_row').appendTo (this.formatParameters.formatSettingsDiv);
let formatInput = $('<input>').addClass ('ov_radio_button').attr ('type', 'radio').attr ('id', format.name).attr ('name', 'format').appendTo (formatDiv);
$('<label>').attr ('for', format.name).html (format.name).appendTo (formatDiv);
let formatLabel = $('<label>').attr ('for', format.name).appendTo (formatDiv);
let formatInput = $('<input>').addClass ('ov_radio_button').attr ('type', 'radio').attr ('id', format.name).attr ('name', 'format').appendTo (formatLabel);
$('<span>').html (format.name).appendTo (formatLabel);
if (i === 0) {
formatInput.prop ('checked', true);
this.formatParameters.selectedFormat = format;

View File

@ -117,8 +117,9 @@ OV.SettingsSidebarPanel = class extends OV.SidebarPanel
function AddRadioButton (contentDiv, themeId, themeName, onChange)
{
let row = $('<div>').addClass ('ov_sidebar_settings_row').appendTo (contentDiv);
let radio = $('<input>').addClass ('ov_radio_button').attr ('type', 'radio').attr ('id', themeId.toString ()).attr ('name', 'theme').appendTo (row);
$('<label>').attr ('for', themeId.toString ()).html (themeName).appendTo (row);
let label = $('<label>').attr ('for', themeId.toString ()).appendTo (row);
let radio = $('<input>').addClass ('ov_radio_button').attr ('type', 'radio').attr ('id', themeId.toString ()).attr ('name', 'theme').appendTo (label);
$('<span>').html (themeName).appendTo (label);
radio.change (() => {
onChange (themeId);
});