Bug 1576601 - Add click listener only to the link in the protections panel info message. r=andreio

Differential Revision: https://phabricator.services.mozilla.com/D47445

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nihanth Subramanya 2019-09-30 10:31:39 +00:00
parent b90f019865
commit ca5756177e

View File

@ -330,8 +330,6 @@ class _ToolbarPanelHub {
wrapperEl.classList.add("whatsNew-message-body");
messageEl.appendChild(wrapperEl);
this._attachClickListener(win, wrapperEl, message);
wrapperEl.appendChild(
this._createElement(doc, "h2", {
classList: "whatsNew-message-title",
@ -343,12 +341,14 @@ class _ToolbarPanelHub {
);
if (message.content.link_text) {
wrapperEl.appendChild(
this._createElement(doc, "a", {
classList: "text-link",
content: message.content.link_text,
})
);
let linkEl = this._createElement(doc, "a", {
classList: "text-link",
content: message.content.link_text,
});
wrapperEl.appendChild(linkEl);
this._attachClickListener(win, linkEl, message);
} else {
this._attachClickListener(win, wrapperEl, message);
}
return messageEl;