You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-05 23:10:41 +03:00
Iterate with new buttons and resize locking
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
@@ -163,16 +163,20 @@ export default class Resizer<C extends IConfig = IConfig> {
|
||||
};
|
||||
|
||||
private onResize = throttle(() => {
|
||||
const distributors = this.getResizeHandles().map(handle => {
|
||||
const {distributor} = this.createSizerAndDistributor(<HTMLDivElement>handle);
|
||||
return distributor;
|
||||
});
|
||||
const distributors = this.getDistributors();
|
||||
|
||||
// relax all items if they had any overconstrained flexboxes
|
||||
distributors.forEach(d => d.start());
|
||||
distributors.forEach(d => d.finish());
|
||||
}, 100, {trailing: true, leading: true});
|
||||
|
||||
public getDistributors = () => {
|
||||
return this.getResizeHandles().map(handle => {
|
||||
const {distributor} = this.createSizerAndDistributor(<HTMLDivElement>handle);
|
||||
return distributor;
|
||||
});
|
||||
};
|
||||
|
||||
private createSizerAndDistributor(
|
||||
resizeHandle: HTMLDivElement,
|
||||
): {sizer: Sizer, distributor: FixedDistributor<any>} {
|
||||
@@ -186,6 +190,7 @@ export default class Resizer<C extends IConfig = IConfig> {
|
||||
}
|
||||
|
||||
private getResizeHandles() {
|
||||
if (!this.container.children) return [];
|
||||
return Array.from(this.container.children).filter(el => {
|
||||
return this.isResizeHandle(<HTMLElement>el);
|
||||
}) as HTMLElement[];
|
||||
|
||||
Reference in New Issue
Block a user