GIFs sending
GIFs fix onScrolledBottom
This commit is contained in:
parent
489ecb974b
commit
d244ac08bd
@ -7,6 +7,8 @@ import appSidebarRight, { AppSidebarRight } from "../../lib/appManagers/appSideb
|
|||||||
import appUsersManager, { User } from "../../lib/appManagers/appUsersManager";
|
import appUsersManager, { User } from "../../lib/appManagers/appUsersManager";
|
||||||
import appInlineBotsManager, { AppInlineBotsManager } from "../../lib/appManagers/AppInlineBotsManager";
|
import appInlineBotsManager, { AppInlineBotsManager } from "../../lib/appManagers/AppInlineBotsManager";
|
||||||
import GifsMasonry from "../gifsMasonry";
|
import GifsMasonry from "../gifsMasonry";
|
||||||
|
import { findUpClassName } from "../../lib/utils";
|
||||||
|
import appImManager from "../../lib/appManagers/appImManager";
|
||||||
|
|
||||||
const ANIMATIONGROUP = 'GIFS-SEARCH';
|
const ANIMATIONGROUP = 'GIFS-SEARCH';
|
||||||
|
|
||||||
@ -39,14 +41,28 @@ export default class AppGifsTab implements SliderTab {
|
|||||||
this.reset();
|
this.reset();
|
||||||
this.search(value);
|
this.search(value);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.scrollable.onScrolledBottom = () => {
|
this.gifsDiv.addEventListener('click', this.onGifsClick);
|
||||||
this.search(this.searchInput.value, false);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.backBtn.parentElement.append(this.searchInput.container);
|
this.backBtn.parentElement.append(this.searchInput.container);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onGifsClick = (e: MouseEvent) => {
|
||||||
|
const target = findUpClassName(e.target, 'gif');
|
||||||
|
if(!target) return;
|
||||||
|
|
||||||
|
const fileID = target.dataset.docID;
|
||||||
|
if(appImManager.chatInputC.sendMessageWithDocument(fileID)) {
|
||||||
|
//this.closeBtn.click();
|
||||||
|
} else {
|
||||||
|
console.warn('got no doc by id:', fileID);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public onClose() {
|
||||||
|
this.scrollable.onScrolledBottom = () => {};
|
||||||
|
}
|
||||||
|
|
||||||
public onCloseAfterTimeout() {
|
public onCloseAfterTimeout() {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.gifsDiv.innerHTML = '';
|
this.gifsDiv.innerHTML = '';
|
||||||
@ -67,6 +83,10 @@ export default class AppGifsTab implements SliderTab {
|
|||||||
//this.renderFeatured();
|
//this.renderFeatured();
|
||||||
this.search('', true);
|
this.search('', true);
|
||||||
this.reset();
|
this.reset();
|
||||||
|
|
||||||
|
this.scrollable.onScrolledBottom = () => {
|
||||||
|
this.search(this.searchInput.value, false);
|
||||||
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user