mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-06-17 22:14:08 +00:00
Add tabindex support to button widgets (#4442)
This pull request adds support for specifying a tabindex for button widgets following the same pattern as the LinkWidget.
This commit is contained in:
parent
b9d20f1868
commit
04c28ba5f2
@ -64,6 +64,10 @@ ButtonWidget.prototype.render = function(parent,nextSibling) {
|
|||||||
if(this["aria-label"]) {
|
if(this["aria-label"]) {
|
||||||
domNode.setAttribute("aria-label",this["aria-label"]);
|
domNode.setAttribute("aria-label",this["aria-label"]);
|
||||||
}
|
}
|
||||||
|
// Set the tabindex
|
||||||
|
if(this.tabIndex) {
|
||||||
|
domNode.setAttribute("tabindex",this.tabIndex);
|
||||||
|
}
|
||||||
// Add a click event handler
|
// Add a click event handler
|
||||||
domNode.addEventListener("click",function (event) {
|
domNode.addEventListener("click",function (event) {
|
||||||
var handled = false;
|
var handled = false;
|
||||||
@ -205,6 +209,7 @@ ButtonWidget.prototype.execute = function() {
|
|||||||
this.setField = this.getAttribute("setField");
|
this.setField = this.getAttribute("setField");
|
||||||
this.setIndex = this.getAttribute("setIndex");
|
this.setIndex = this.getAttribute("setIndex");
|
||||||
this.popupTitle = this.getAttribute("popupTitle");
|
this.popupTitle = this.getAttribute("popupTitle");
|
||||||
|
this.tabIndex = this.getAttribute("tabindex");
|
||||||
// Make child widgets
|
// Make child widgets
|
||||||
this.makeChildWidgets();
|
this.makeChildWidgets();
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user