Fix resolution for reply image
This commit is contained in:
parent
f249f7b82b
commit
632e7eacf6
@ -30,17 +30,20 @@ export default class ReplyContainer extends DivAndCaption<(title: string, subtit
|
|||||||
//console.log('wrap reply', media);
|
//console.log('wrap reply', media);
|
||||||
|
|
||||||
if(media.photo || (media.document && ['video'].indexOf(media.document.type) !== -1)) {
|
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');
|
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) {
|
||||||
if(sizes && sizes[0].bytes) {
|
const sizes = photo.sizes || photo.thumbs;
|
||||||
appPhotosManager.setAttachmentPreview(sizes[0].bytes, replyMedia, false, true);
|
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(() => {
|
.then(() => {
|
||||||
renderImageFromUrl(replyMedia, photo._ == 'photo' ? photo.url : appPhotosManager.getDocumentCachedThumb(photo.id).url);
|
renderImageFromUrl(replyMedia, photo._ == 'photo' ? photo.url : appPhotosManager.getDocumentCachedThumb(photo.id).url);
|
||||||
});
|
});
|
||||||
|
@ -380,7 +380,7 @@ export default class PollElement extends HTMLElement {
|
|||||||
|
|
||||||
attributeChangedCallback(name: string, oldValue: string, newValue: string) {
|
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') {
|
if(name == 'poll-id') {
|
||||||
this.pollID = newValue;
|
this.pollID = newValue;
|
||||||
} else if(name == 'message-id') {
|
} else if(name == 'message-id') {
|
||||||
|
@ -1225,7 +1225,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
z-index: 5;
|
//z-index: 5;
|
||||||
top: 8px;
|
top: 8px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
transform: translate3d(0, calc(-100% - 10px), 0);
|
transform: translate3d(0, calc(-100% - 10px), 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user