function togglePlatformDependent()

in scripts/platform-content-handler.js [243:267]


function togglePlatformDependent(e, container) {
    let target = e.target
    if (target.tagName !== 'BUTTON') return;
    let index = target.getAttribute('data-toggle')

    for (let child of container.children) {
        if (child.hasAttribute('data-toggle-list')) {
            for (let bm of child.children) {
                if (bm === target) {
                    bm.setAttribute('data-active', "")
                    bm.setAttribute('aria-pressed', "true")
                } else if (bm !== target) {
                    bm.removeAttribute('data-active')
                    bm.removeAttribute('aria-pressed')
                }
            }
        } else if (child.getAttribute('data-togglable') === index) {
            child.setAttribute('data-active', "")
            child.setAttribute('aria-pressed', "true")
        } else {
            child.removeAttribute('data-active')
            child.removeAttribute('aria-pressed')
        }
    }
}