os-js / osjs-client

OS.js Client Module
https://manual.os-js.org/
Other
31 stars 31 forks source link

Window#resizeFit does not take outer elements into account #60

Closed andersevenrud closed 5 years ago

andersevenrud commented 5 years ago

When an application uses Window#resizeFit it will try to resize the window to fit the content of the DOM element you give, but this does not work correctly as it does not take outer elements into account.

So if you have a toolbar, and want to resize the content to fit whatever is below, it will not fit (because it adds the toolbar height).

andersevenrud commented 5 years ago

@mikeblackstock

I've made some improvements to this. It's not perfect, but it does the job :)

You can see it in action here: https://www.youtube.com/watch?v=k4k48YlAH90&feature=youtu.be

I'll have this in the next @osjs/client release.

mikeblackstock commented 5 years ago

That's great, Anders - thanks! Little snippets of music opened in windows precisely matching their size will have an immense cool factor :) @andersevenrud

andersevenrud commented 5 years ago

@mikeblackstock I have published a new release of @osjs/client with this change.

npm update @osjs/client and npm run build to update :)

mikeblackstock commented 5 years ago

@andersevenrud awesome - thank you! https://youtu.be/8hCpsvtNqMU

andersevenrud commented 5 years ago

Still needs a little bit of work, but I believe it's a bit better than it was :)