Iterate the resizer
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
f72b1e0c7d
commit
1a45d18b94
5 changed files with 34 additions and 9 deletions
|
@ -68,11 +68,19 @@ export default class Sizer {
|
|||
return offset;
|
||||
}
|
||||
|
||||
public setItemSize(item: HTMLElement, size: number) {
|
||||
public getDesiredItemSize(item: HTMLElement) {
|
||||
if (this.vertical) {
|
||||
item.style.height = `${Math.round(size)}px`;
|
||||
return item.style.height;
|
||||
} else {
|
||||
item.style.width = `${Math.round(size)}px`;
|
||||
return item.style.width;
|
||||
}
|
||||
}
|
||||
|
||||
public setItemSize(item: HTMLElement, size: string) {
|
||||
if (this.vertical) {
|
||||
item.style.height = size;
|
||||
} else {
|
||||
item.style.width = size;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue