未验证 提交 d200e76c 编写于 作者: C Christopher Leidigh 提交者: GitHub

Settings: Only add label target for checkbox (#57129)

上级 80354232
......@@ -678,11 +678,11 @@ export class SettingsRenderer implements ITreeRenderer {
// Also have to ignore embedded links - too buried to stop propagation
toDispose.push(DOM.addDisposableListener(descriptionElement, DOM.EventType.MOUSE_DOWN, (e) => {
const targetElement = <HTMLElement>e.toElement;
const targetId = descriptionElement.getAttribute('checkboxLabelTargetId');
const targetId = descriptionElement.getAttribute('checkbox-label-target-id');
// Make sure we are not a link and the target ID matches
// Toggle target checkbox
if (targetElement.tagName !== 'A' && targetId === template.checkbox.domNode.id) {
if (targetElement.tagName.toLowerCase() !== 'a' && targetId === template.checkbox.domNode.id) {
template.checkbox.checked = template.checkbox.checked ? false : true;
}
DOM.EventHelper.stop(e);
......@@ -949,9 +949,11 @@ export class SettingsRenderer implements ITreeRenderer {
template.descriptionElement.innerText = element.description;
}
// Add checkbox target to description clickable and able to toggle checkbox
const checkbox_id = (element.displayCategory + '_' + element.displayLabel).replace(/ /g, '_') + '_Item';
template.descriptionElement.setAttribute('checkboxLabelTargetId', checkbox_id);
if (templateId === SETTINGS_BOOL_TEMPLATE_ID) {
// Add checkbox target to description clickable and able to toggle checkbox
const checkbox_id = (element.displayCategory + '_' + element.displayLabel).replace(/ /g, '_') + '_Item';
template.descriptionElement.setAttribute('checkbox-label-target-id', checkbox_id);
}
if (element.overriddenScopeList.length) {
let otherOverridesLabel = element.isConfigured ?
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册