some more optimizations
This commit is contained in:
parent
408db34135
commit
e96908c9dd
@ -1387,9 +1387,13 @@ export function wrapSticker({doc, div, middleware, lazyLoadQueue, group, play, o
|
|||||||
if(thumb._ === 'photoPathSize') {
|
if(thumb._ === 'photoPathSize') {
|
||||||
if(thumb.bytes.length) {
|
if(thumb.bytes.length) {
|
||||||
const d = appPhotosManager.getPathFromPhotoPathSize(thumb);
|
const d = appPhotosManager.getPathFromPhotoPathSize(thumb);
|
||||||
div.innerHTML = `<svg class="rlottie-vector media-sticker thumbnail" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 ${doc.w || 512} ${doc.h || 512}" xml:space="preserve">
|
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
||||||
<path d="${d}"/>
|
svg.classList.add('rlottie-vector', 'media-sticker', 'thumbnail');
|
||||||
</svg>`;
|
svg.setAttributeNS(null, 'viewBox', `0 0 ${doc.w || 512} ${doc.h || 512}`);
|
||||||
|
const path = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
||||||
|
path.setAttributeNS(null, 'd', d);
|
||||||
|
svg.append(path);
|
||||||
|
div.append(svg);
|
||||||
} else {
|
} else {
|
||||||
thumb = doc.thumbs.find(t => (t as PhotoSize.photoStrippedSize).bytes?.length) || thumb;
|
thumb = doc.thumbs.find(t => (t as PhotoSize.photoStrippedSize).bytes?.length) || thumb;
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,8 @@
|
|||||||
export default function setInnerHTML(elem: Element, html: string | DocumentFragment) {
|
export default function setInnerHTML(elem: Element, html: string | DocumentFragment) {
|
||||||
elem.setAttribute('dir', 'auto');
|
elem.setAttribute('dir', 'auto');
|
||||||
if(typeof(html) === 'string') {
|
if(typeof(html) === 'string') {
|
||||||
elem.innerHTML = html;
|
if(!html) elem.textContent = '';
|
||||||
|
else elem.innerHTML = html;
|
||||||
} else {
|
} else {
|
||||||
elem.textContent = '';
|
elem.textContent = '';
|
||||||
elem.append(html);
|
elem.append(html);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user