Fix inline bots combined results

This commit is contained in:
Eduard Kuzmenko 2021-08-19 14:09:08 +03:00
parent 424c44e5eb
commit 61185c7e92
2 changed files with 17 additions and 6 deletions

View File

@ -156,11 +156,19 @@ export default class InlineHelper extends AutocompleteHelper {
if(item._ === 'botInlineResult') { if(item._ === 'botInlineResult') {
if(item.thumb && item.thumb.mime_type.indexOf('image/') === 0) { if(item.thumb && item.thumb.mime_type.indexOf('image/') === 0) {
const mediaContainer = document.createElement('div'); let mediaContainer: HTMLElement;
mediaContainer.classList.add('media-container'); if(preview) {
mediaContainer = document.createElement('div');
preview.append(mediaContainer);
} else {
mediaContainer = container;
}
mediaContainer.classList.add('media-container');
isGallery && mediaContainer.classList.add('no-border-radius');
this.lazyLoadQueue.push({ this.lazyLoadQueue.push({
div: preview, div: container,
load: () => { load: () => {
return appDownloadManager.download({ return appDownloadManager.download({
dcId: 4, dcId: 4,
@ -180,8 +188,6 @@ export default class InlineHelper extends AutocompleteHelper {
}); });
} }
}); });
preview.append(mediaContainer);
} }
} else { } else {
const media = item.document as MyDocument || item.photo as MyPhoto; const media = item.document as MyDocument || item.photo as MyPhoto;
@ -199,6 +205,7 @@ export default class InlineHelper extends AutocompleteHelper {
} }
} else if(media) { } else if(media) {
const size = isGallery ? 48 : undefined; const size = isGallery ? 48 : undefined;
isGallery && container.classList.add('no-border-radius');
wrapPhoto({ wrapPhoto({
photo: media, photo: media,
container: isGallery ? container : preview, container: isGallery ? container : preview,

View File

@ -151,6 +151,10 @@ Utility Classes
white-space: pre-wrap !important; white-space: pre-wrap !important;
} }
.no-border-radius {
border-radius: 0 !important;
}
/* .flex-grow { /* .flex-grow {
flex-grow: 1; flex-grow: 1;
} }