Fix resolution for reply image

This commit is contained in:
morethanwords 2020-10-13 17:10:27 +03:00
parent f249f7b82b
commit 632e7eacf6
3 changed files with 13 additions and 10 deletions

View File

@ -30,17 +30,20 @@ export default class ReplyContainer extends DivAndCaption<(title: string, subtit
//console.log('wrap reply', media);
if(media.photo || (media.document && ['video'].indexOf(media.document.type) !== -1)) {
let replyMedia = document.createElement('div');
const replyMedia = document.createElement('div');
replyMedia.classList.add(this.className + '-media');
let photo = media.photo || media.document;
const photo = media.photo || media.document;
let sizes = photo.sizes || photo.thumbs;
if(photo._ == 'document' || !photo.downloaded) {
const sizes = photo.sizes || photo.thumbs;
if(sizes && sizes[0].bytes) {
appPhotosManager.setAttachmentPreview(sizes[0].bytes, replyMedia, false, true);
}
}
appPhotosManager.preloadPhoto(photo, appPhotosManager.choosePhotoSize(photo, 32, 32))
const size = appPhotosManager.choosePhotoSize(photo, 32, 32/* mediaSizes.active.regular.width, mediaSizes.active.regular.height */);
appPhotosManager.preloadPhoto(photo, size)
.then(() => {
renderImageFromUrl(replyMedia, photo._ == 'photo' ? photo.url : appPhotosManager.getDocumentCachedThumb(photo.id).url);
});

View File

@ -380,7 +380,7 @@ export default class PollElement extends HTMLElement {
attributeChangedCallback(name: string, oldValue: string, newValue: string) {
// вызывается при изменении одного из перечисленных выше атрибутов
console.log('Poll: attributeChangedCallback', name, oldValue, newValue, this.isConnected);
// console.log('Poll: attributeChangedCallback', name, oldValue, newValue, this.isConnected);
if(name == 'poll-id') {
this.pollID = newValue;
} else if(name == 'message-id') {

View File

@ -1225,7 +1225,7 @@
display: flex;
width: 100%;
justify-content: center;
z-index: 5;
//z-index: 5;
top: 8px;
align-items: center;
transform: translate3d(0, calc(-100% - 10px), 0);