Merge pull request #2591 from mozilla/MNTOR-773/fix-landing-breach-logo
fix missing breach logo on landing page
This commit is contained in:
Коммит
e861f650ca
|
@ -1,10 +1,5 @@
|
|||
import { sendPing } from './fxa-analytics.js'
|
||||
|
||||
function replaceLogo (e) {
|
||||
e.target.src = '/img/logos/missing-logo-icon.png'
|
||||
e.target.removeEventListener('error', replaceLogo)
|
||||
return true
|
||||
}
|
||||
import { replaceLogo } from './monitor.js'
|
||||
|
||||
const makeBreachInfoSpans = (className, spanContent, wrapper) => {
|
||||
const span = document.createElement('span')
|
||||
|
|
|
@ -465,6 +465,11 @@ function getPageAttribution () {
|
|||
return `&utm_content=${page}`
|
||||
}
|
||||
|
||||
function replaceLogo (e) {
|
||||
e.target.src = '/img/logos/missing-logo-icon.png'
|
||||
e.target.removeEventListener('error', replaceLogo)
|
||||
}
|
||||
|
||||
(async () => {
|
||||
document.addEventListener('touchstart', function () { }, true)
|
||||
const win = window
|
||||
|
@ -499,6 +504,10 @@ function getPageAttribution () {
|
|||
}
|
||||
})
|
||||
|
||||
document.querySelectorAll('.breach-logo').forEach(logo => {
|
||||
logo.addEventListener('error', replaceLogo)
|
||||
})
|
||||
|
||||
document.addEventListener('scroll', () => toggleHeaderStates(header, win))
|
||||
|
||||
document.querySelectorAll('.toggle').forEach(toggle => {
|
||||
|
@ -572,4 +581,4 @@ function getPageAttribution () {
|
|||
}
|
||||
})()
|
||||
|
||||
export { findAncestor, doOauth }
|
||||
export { findAncestor, doOauth, replaceLogo }
|
||||
|
|
Загрузка…
Ссылка в новой задаче