Fossil SCM

chat: added 'role'='button' attribute to various non-button button-like elements, per forum request.

stephan 2020-12-25 19:20 trunk
Commit 6506b6de437636a63d333cd3cb12f9ec795244fb960aaa0ce3a9de75048a3927
1 file changed +3
--- src/chat.js
+++ src/chat.js
@@ -526,10 +526,11 @@
526526
settingsPopup.options.refresh = function(){
527527
D.clearElement(this.e);
528528
settingsOps.forEach(function(op){
529529
const line = D.addClass(D.span(), 'menu-entry');
530530
const btn = D.append(D.addClass(D.span(), 'button'), op.label);
531
+ D.attr(btn, 'role', 'button');
531532
const callback = function(ev){
532533
settingsPopup.hide();
533534
op.callback.call(this,ev);
534535
};
535536
D.append(line, btn);
@@ -546,10 +547,11 @@
546547
Reminder:
547548
settingsPopup.installClickToHide();
548549
Don't do this for this popup! It interferes with the embedded
549550
"?" buttons in the popup, which are also PopupWidget users.
550551
*/
552
+ D.attr(settingsButton, 'role', 'button');
551553
settingsButton.addEventListener('click',function(ev){
552554
//ev.preventDefault();
553555
if(settingsPopup.isShown()) settingsPopup.hide();
554556
else settingsPopup.show(settingsButton);
555557
/* Reminder: we cannot toggle the visibility from her
@@ -591,10 +593,11 @@
591593
row.dataset.msgid = m.msgid;
592594
row.dataset.xfrom = m.xfrom;
593595
row.dataset.timestamp = m.mtime;
594596
Chat.injectMessageElem(row,atEnd);
595597
eWho.addEventListener('click', handleLegendClicked, false);
598
+ eWho.setAttribute('role', 'button');
596599
if( m.xfrom==Chat.me ){
597600
eWho.setAttribute('align', Chat.msgMyAlign);
598601
if('right'===Chat.msgMyAlign){
599602
row.style.justifyContent = "flex-end";
600603
}else{
601604
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button