Skip to content

Commit

Permalink
build .custom-header-link-title with an <a> tag if URL present
Browse files Browse the repository at this point in the history
  • Loading branch information
alxndr authored May 28, 2024
1 parent f3561ce commit 68fb1f5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion javascripts/discourse/widgets/custom-header-link.js.es6
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ createWidget("custom-header-link", {

html(attrs) {
const iconHTML = buildIconHTML(attrs.icon);
const titleHTML = h("span.custom-header-link-title", attrs.title);
const titleHTML = this.attrs.url
? h( "a.custom-header-link-title", attrs.title, {href: this.attrs.url})
: h("span.custom-header-link-title", attrs.title);
const permissions = this.handleLinkPermissions(attrs);
const allDropdownItems = settings.dropdown_links
? JSON.parse(settings.dropdown_links)
Expand Down

0 comments on commit 68fb1f5

Please sign in to comment.