Fossil SCM
chat: added 'role'='button' attribute to various non-button button-like elements, per forum request.
Commit
6506b6de437636a63d333cd3cb12f9ec795244fb960aaa0ce3a9de75048a3927
Parent
e525317e631889f…
1 file changed
+3
+3
| --- src/chat.js | ||
| +++ src/chat.js | ||
| @@ -526,10 +526,11 @@ | ||
| 526 | 526 | settingsPopup.options.refresh = function(){ |
| 527 | 527 | D.clearElement(this.e); |
| 528 | 528 | settingsOps.forEach(function(op){ |
| 529 | 529 | const line = D.addClass(D.span(), 'menu-entry'); |
| 530 | 530 | const btn = D.append(D.addClass(D.span(), 'button'), op.label); |
| 531 | + D.attr(btn, 'role', 'button'); | |
| 531 | 532 | const callback = function(ev){ |
| 532 | 533 | settingsPopup.hide(); |
| 533 | 534 | op.callback.call(this,ev); |
| 534 | 535 | }; |
| 535 | 536 | D.append(line, btn); |
| @@ -546,10 +547,11 @@ | ||
| 546 | 547 | Reminder: |
| 547 | 548 | settingsPopup.installClickToHide(); |
| 548 | 549 | Don't do this for this popup! It interferes with the embedded |
| 549 | 550 | "?" buttons in the popup, which are also PopupWidget users. |
| 550 | 551 | */ |
| 552 | + D.attr(settingsButton, 'role', 'button'); | |
| 551 | 553 | settingsButton.addEventListener('click',function(ev){ |
| 552 | 554 | //ev.preventDefault(); |
| 553 | 555 | if(settingsPopup.isShown()) settingsPopup.hide(); |
| 554 | 556 | else settingsPopup.show(settingsButton); |
| 555 | 557 | /* Reminder: we cannot toggle the visibility from her |
| @@ -591,10 +593,11 @@ | ||
| 591 | 593 | row.dataset.msgid = m.msgid; |
| 592 | 594 | row.dataset.xfrom = m.xfrom; |
| 593 | 595 | row.dataset.timestamp = m.mtime; |
| 594 | 596 | Chat.injectMessageElem(row,atEnd); |
| 595 | 597 | eWho.addEventListener('click', handleLegendClicked, false); |
| 598 | + eWho.setAttribute('role', 'button'); | |
| 596 | 599 | if( m.xfrom==Chat.me ){ |
| 597 | 600 | eWho.setAttribute('align', Chat.msgMyAlign); |
| 598 | 601 | if('right'===Chat.msgMyAlign){ |
| 599 | 602 | row.style.justifyContent = "flex-end"; |
| 600 | 603 | }else{ |
| 601 | 604 |
| --- src/chat.js | |
| +++ src/chat.js | |
| @@ -526,10 +526,11 @@ | |
| 526 | settingsPopup.options.refresh = function(){ |
| 527 | D.clearElement(this.e); |
| 528 | settingsOps.forEach(function(op){ |
| 529 | const line = D.addClass(D.span(), 'menu-entry'); |
| 530 | const btn = D.append(D.addClass(D.span(), 'button'), op.label); |
| 531 | const callback = function(ev){ |
| 532 | settingsPopup.hide(); |
| 533 | op.callback.call(this,ev); |
| 534 | }; |
| 535 | D.append(line, btn); |
| @@ -546,10 +547,11 @@ | |
| 546 | Reminder: |
| 547 | settingsPopup.installClickToHide(); |
| 548 | Don't do this for this popup! It interferes with the embedded |
| 549 | "?" buttons in the popup, which are also PopupWidget users. |
| 550 | */ |
| 551 | settingsButton.addEventListener('click',function(ev){ |
| 552 | //ev.preventDefault(); |
| 553 | if(settingsPopup.isShown()) settingsPopup.hide(); |
| 554 | else settingsPopup.show(settingsButton); |
| 555 | /* Reminder: we cannot toggle the visibility from her |
| @@ -591,10 +593,11 @@ | |
| 591 | row.dataset.msgid = m.msgid; |
| 592 | row.dataset.xfrom = m.xfrom; |
| 593 | row.dataset.timestamp = m.mtime; |
| 594 | Chat.injectMessageElem(row,atEnd); |
| 595 | eWho.addEventListener('click', handleLegendClicked, false); |
| 596 | if( m.xfrom==Chat.me ){ |
| 597 | eWho.setAttribute('align', Chat.msgMyAlign); |
| 598 | if('right'===Chat.msgMyAlign){ |
| 599 | row.style.justifyContent = "flex-end"; |
| 600 | }else{ |
| 601 |
| --- src/chat.js | |
| +++ src/chat.js | |
| @@ -526,10 +526,11 @@ | |
| 526 | settingsPopup.options.refresh = function(){ |
| 527 | D.clearElement(this.e); |
| 528 | settingsOps.forEach(function(op){ |
| 529 | const line = D.addClass(D.span(), 'menu-entry'); |
| 530 | const btn = D.append(D.addClass(D.span(), 'button'), op.label); |
| 531 | D.attr(btn, 'role', 'button'); |
| 532 | const callback = function(ev){ |
| 533 | settingsPopup.hide(); |
| 534 | op.callback.call(this,ev); |
| 535 | }; |
| 536 | D.append(line, btn); |
| @@ -546,10 +547,11 @@ | |
| 547 | Reminder: |
| 548 | settingsPopup.installClickToHide(); |
| 549 | Don't do this for this popup! It interferes with the embedded |
| 550 | "?" buttons in the popup, which are also PopupWidget users. |
| 551 | */ |
| 552 | D.attr(settingsButton, 'role', 'button'); |
| 553 | settingsButton.addEventListener('click',function(ev){ |
| 554 | //ev.preventDefault(); |
| 555 | if(settingsPopup.isShown()) settingsPopup.hide(); |
| 556 | else settingsPopup.show(settingsButton); |
| 557 | /* Reminder: we cannot toggle the visibility from her |
| @@ -591,10 +593,11 @@ | |
| 593 | row.dataset.msgid = m.msgid; |
| 594 | row.dataset.xfrom = m.xfrom; |
| 595 | row.dataset.timestamp = m.mtime; |
| 596 | Chat.injectMessageElem(row,atEnd); |
| 597 | eWho.addEventListener('click', handleLegendClicked, false); |
| 598 | eWho.setAttribute('role', 'button'); |
| 599 | if( m.xfrom==Chat.me ){ |
| 600 | eWho.setAttribute('align', Chat.msgMyAlign); |
| 601 | if('right'===Chat.msgMyAlign){ |
| 602 | row.style.justifyContent = "flex-end"; |
| 603 | }else{ |
| 604 |