Browse Source

Fix inline bots combined results

master
Eduard Kuzmenko 3 years ago
parent
commit
61185c7e92
  1. 19
      src/components/chat/inlineHelper.ts
  2. 4
      src/scss/components/_global.scss

19
src/components/chat/inlineHelper.ts

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

4
src/scss/components/_global.scss

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

Loading…
Cancel
Save