introduce resizeFromContainerOffset method on distributor

up till now, resize received the offset of the resize handle
within the container upon resizing, and would then calculate
it's new size. For this first item in the container, this is
the same, and has therefor not been a problem yet.

Now however, we'll need to be able to programatically
(from localStorage) set the size of any roomsublist,
so need a method we can call with just the size and not an offset
within the container. The resizer calls the new method,
which subsequently calls resize.

This also has the nice side-effect that you can now easily
call super.resize after having transformed the new item size
This commit is contained in:
Bruno Windels 2018-11-26 16:42:58 +01:00
parent 3e496833fc
commit dae509d0eb
3 changed files with 23 additions and 17 deletions

View file

@ -88,7 +88,7 @@ export class Resizer {
const onMouseMove = (event) => {
const offset = sizer.offsetFromEvent(event);
distributor.resize(offset);
distributor.resizeFromContainerOffset(offset);
};
const body = document.body;