1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-16 10:29:54 +00:00

Fix undefined tabindex problem with link widget

The tabindex attribute was being set to the string “undefined” if the
attribute was not specified. The fix is to only set the tabindex
attribute if the attribute was specified.
This commit is contained in:
Jermolene 2015-03-25 11:11:07 +00:00
parent 0ea1dad2c8
commit 4eb2e3d3b4

View File

@ -84,9 +84,11 @@ LinkWidget.prototype.renderLink = function(parent,nextSibling) {
wikiLinkText = wikiLinkText.replace("$uri_doubleencoded$",encodeURIComponent(encodeURIComponent(this.to)));
wikiLinkText = this.getVariable("tv-get-export-link",{params: [{name: "to",value: this.to}],defaultValue: wikiLinkText});
if(tag === "a") {
domNode.setAttribute("href",wikiLinkText);
domNode.setAttribute("href",wikiLinkText);
}
if(this.tabIndex) {
domNode.setAttribute("tabindex",this.tabIndex);
}
domNode.setAttribute("tabindex",this.tabIndex);
// Set the tooltip
// HACK: Performance issues with re-parsing the tooltip prevent us defaulting the tooltip to "<$transclude field='tooltip'><$transclude field='title'/></$transclude>"
var tooltipWikiText = this.tooltip || this.getVariable("tv-wikilink-tooltip");