tracker: slight update to use iconCache for spritemaps
This commit is contained in:
parent
f402a44e18
commit
1d113174e4
1 changed files with 9 additions and 10 deletions
|
|
@ -43,6 +43,15 @@ async function parseUseEl(
|
||||||
|
|
||||||
let [url, symbolId] = href.split('#')
|
let [url, symbolId] = href.split('#')
|
||||||
|
|
||||||
|
if (!url && !symbolId) {
|
||||||
|
console.warn('Openreplay: Invalid xlink:href or href found on <use>.')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (iconCache[symbolId]) {
|
||||||
|
return iconCache[symbolId]
|
||||||
|
}
|
||||||
|
|
||||||
// happens if svg spritemap is local, fastest case for us
|
// happens if svg spritemap is local, fastest case for us
|
||||||
if (!url && symbolId) {
|
if (!url && symbolId) {
|
||||||
const symbol = document.querySelector(href)
|
const symbol = document.querySelector(href)
|
||||||
|
|
@ -61,16 +70,6 @@ async function parseUseEl(
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!url && !symbolId) {
|
|
||||||
console.warn('Openreplay: Invalid xlink:href or href found on <use>.')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (iconCache[symbolId]) {
|
|
||||||
return iconCache[symbolId]
|
|
||||||
}
|
|
||||||
|
|
||||||
let svgDoc: Document
|
let svgDoc: Document
|
||||||
if (svgUrlCache[url]) {
|
if (svgUrlCache[url]) {
|
||||||
if (svgUrlCache[url] === 1) {
|
if (svgUrlCache[url] === 1) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue