From 4eb2e3d3b4edbb0fc22a3b87203535dd44f0fa29 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Wed, 25 Mar 2015 11:11:07 +0000 Subject: [PATCH] Fix undefined tabindex problem with link widget MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- core/modules/widgets/link.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/modules/widgets/link.js b/core/modules/widgets/link.js index 17c35dcff..650308b8c 100755 --- a/core/modules/widgets/link.js +++ b/core/modules/widgets/link.js @@ -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'/>" var tooltipWikiText = this.tooltip || this.getVariable("tv-wikilink-tooltip");