Fix search reset
Fix search in media viewer Maybe fixed blinking in media viewer
This commit is contained in:
parent
275bd4f77d
commit
1139a73fb5
@ -895,17 +895,22 @@ class AppMediaViewerBase<ContentAdditionType extends string, ButtonsAdditionType
|
|||||||
let thumbPromise: Promise<any> = Promise.resolve();
|
let thumbPromise: Promise<any> = Promise.resolve();
|
||||||
if(useContainerAsTarget) {
|
if(useContainerAsTarget) {
|
||||||
const cacheContext = appPhotosManager.getCacheContext(media);
|
const cacheContext = appPhotosManager.getCacheContext(media);
|
||||||
|
let img: HTMLImageElement;
|
||||||
if(cacheContext.downloaded) {
|
if(cacheContext.downloaded) {
|
||||||
const img = new Image();
|
img = new Image();
|
||||||
img.src = cacheContext.url;
|
img.src = cacheContext.url;
|
||||||
container.append(img);
|
|
||||||
} else {
|
} else {
|
||||||
const gotThumb = appPhotosManager.getStrippedThumbIfNeeded(media);
|
const gotThumb = appPhotosManager.getStrippedThumbIfNeeded(media);
|
||||||
if(gotThumb) {
|
if(gotThumb) {
|
||||||
thumbPromise = gotThumb.loadPromise;
|
thumbPromise = gotThumb.loadPromise;
|
||||||
container.append(gotThumb.image);
|
img = gotThumb.image;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(img) {
|
||||||
|
img.classList.add('thumbnail');
|
||||||
|
container.append(img);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const size = appPhotosManager.setAttachmentSize(media, container, maxWidth, maxHeight, mediaSizes.isMobile ? false : true);
|
const size = appPhotosManager.setAttachmentSize(media, container, maxWidth, maxHeight, mediaSizes.isMobile ? false : true);
|
||||||
|
|
||||||
@ -1106,6 +1111,7 @@ class AppMediaViewerBase<ContentAdditionType extends string, ButtonsAdditionType
|
|||||||
const haveImage = div.firstElementChild?.tagName === 'IMG' ? div.firstElementChild as HTMLImageElement : null;
|
const haveImage = div.firstElementChild?.tagName === 'IMG' ? div.firstElementChild as HTMLImageElement : null;
|
||||||
if(!haveImage || haveImage.src !== url) {
|
if(!haveImage || haveImage.src !== url) {
|
||||||
let image = new Image();
|
let image = new Image();
|
||||||
|
image.classList.add('thumbnail');
|
||||||
|
|
||||||
//this.log('will renderImageFromUrl:', image, div, target);
|
//this.log('will renderImageFromUrl:', image, div, target);
|
||||||
|
|
||||||
@ -1300,9 +1306,9 @@ export default class AppMediaViewer extends AppMediaViewerBase<'caption', 'delet
|
|||||||
minDate: this.searchContext.minDate,
|
minDate: this.searchContext.minDate,
|
||||||
maxDate: this.searchContext.maxDate
|
maxDate: this.searchContext.maxDate
|
||||||
}).then(value => {
|
}).then(value => {
|
||||||
/* if(DEBUG) {
|
if(DEBUG) {
|
||||||
this.log('loaded more media by maxId:', maxId, value, older, this.reverse);
|
this.log('loaded more media by maxId:', maxId, value, older, this.reverse);
|
||||||
} */
|
}
|
||||||
|
|
||||||
if(value.next_rate) {
|
if(value.next_rate) {
|
||||||
this.searchContext.nextRate = value.next_rate;
|
this.searchContext.nextRate = value.next_rate;
|
||||||
|
@ -738,16 +738,20 @@ export default class ChatBubbles {
|
|||||||
|
|
||||||
ids.forEach(id => {
|
ids.forEach(id => {
|
||||||
let withTail = this.bubbles[id].classList.contains('with-media-tail');
|
let withTail = this.bubbles[id].classList.contains('with-media-tail');
|
||||||
let str = '.album-item img, .album-item video, .preview img, .preview video, ';
|
let str = '.album-item video, .album-item img, .preview video, .preview img, ';
|
||||||
if(withTail) {
|
if(withTail) {
|
||||||
str += '.bubble__media-container';
|
str += '.bubble__media-container';
|
||||||
} else {
|
} else {
|
||||||
str += '.attachment img, .attachment video';
|
str += '.attachment video, .attachment img';
|
||||||
}
|
}
|
||||||
|
|
||||||
let elements = this.bubbles[id].querySelectorAll(str) as NodeListOf<HTMLElement>;
|
let elements = this.bubbles[id].querySelectorAll(str) as NodeListOf<HTMLElement>;
|
||||||
|
const parents: Set<HTMLElement> = new Set();
|
||||||
Array.from(elements).forEach((element: HTMLElement) => {
|
Array.from(elements).forEach((element: HTMLElement) => {
|
||||||
let albumItem = findUpClassName(element, 'album-item');
|
let albumItem = findUpClassName(element, 'album-item');
|
||||||
|
const parent = albumItem || element.parentElement;
|
||||||
|
if(parents.has(parent)) return;
|
||||||
|
parents.add(parent);
|
||||||
targets.push({
|
targets.push({
|
||||||
element,
|
element,
|
||||||
mid: +albumItem?.dataset.mid || id,
|
mid: +albumItem?.dataset.mid || id,
|
||||||
|
@ -401,8 +401,8 @@ export class AppSidebarLeft extends SidebarSlider {
|
|||||||
if(hideNewBtnMenuTimeout) clearTimeout(hideNewBtnMenuTimeout);
|
if(hideNewBtnMenuTimeout) clearTimeout(hideNewBtnMenuTimeout);
|
||||||
|
|
||||||
if(id === 0) {
|
if(id === 0) {
|
||||||
|
searchSuper.selectTab(0, false);
|
||||||
this.inputSearch.onClearClick();
|
this.inputSearch.onClearClick();
|
||||||
resetSearch();
|
|
||||||
hideNewBtnMenuTimeout = window.setTimeout(() => {
|
hideNewBtnMenuTimeout = window.setTimeout(() => {
|
||||||
hideNewBtnMenuTimeout = 0;
|
hideNewBtnMenuTimeout = 0;
|
||||||
this.newBtnMenu.classList.remove('is-hidden');
|
this.newBtnMenu.classList.remove('is-hidden');
|
||||||
|
@ -2933,7 +2933,7 @@ export class AppMessagesManager {
|
|||||||
if(!peerId) peerId = 0;
|
if(!peerId) peerId = 0;
|
||||||
if(!query) query = '';
|
if(!query) query = '';
|
||||||
if(!inputFilter) inputFilter = {_: 'inputMessagesFilterEmpty'};
|
if(!inputFilter) inputFilter = {_: 'inputMessagesFilterEmpty'};
|
||||||
if(!limit) limit = 20;
|
if(limit === undefined) limit = 20;
|
||||||
if(!nextRate) nextRate = 0;
|
if(!nextRate) nextRate = 0;
|
||||||
if(!backLimit) backLimit = 0;
|
if(!backLimit) backLimit = 0;
|
||||||
|
|
||||||
|
@ -257,6 +257,7 @@
|
|||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
//object-fit: contain;
|
//object-fit: contain;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
transition: var(--open-duration) opacity;
|
||||||
|
|
||||||
/* border-radius: inherit;
|
/* border-radius: inherit;
|
||||||
transition: var(--open-duration) border-radius; */
|
transition: var(--open-duration) border-radius; */
|
||||||
@ -350,7 +351,6 @@
|
|||||||
|
|
||||||
&.hiding {
|
&.hiding {
|
||||||
img, video {
|
img, video {
|
||||||
transition: var(--open-duration) opacity;
|
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -360,9 +360,10 @@
|
|||||||
&-aspecter {
|
&-aspecter {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
transform: scale(1);
|
transform: scale3d(1, 1, 1);
|
||||||
//overflow: hidden; // WARNING
|
//overflow: hidden; // WARNING
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
border-radius: 0;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user