Bug 993329 - Remove inline event handlers in newTab.xul [r=adw]

Add listener from page's init instead of inline.

--HG--
extra : rebase_source : 3a635d20bbb2b35caa23c4d7a5823172d066aee9
This commit is contained in:
Maxim Zhilyaev 2014-04-10 23:15:59 -07:00
parent 77f49a161b
commit 7718402af0
2 changed files with 2 additions and 1 deletions

View File

@ -21,7 +21,6 @@
<xul:description>&newtab.panel.message;</xul:description>
<xul:label class="text-link"
href="https://support.mozilla.org/kb/how-do-sponsored-tiles-work"
onclick="this.parentNode.hidePopup();"
value="&newtab.panel.link.text;" />
</xul:panel>

View File

@ -25,6 +25,8 @@ let gPage = {
// Initialize sponsored panel
this._sponsoredPanel = document.getElementById("sponsored-panel");
let link = this._sponsoredPanel.querySelector(".text-link");
link.addEventListener("click", () => this._sponsoredPanel.hidePopup());
// Check if the new tab feature is enabled.
let enabled = gAllPages.enabled;