-
Notifications
You must be signed in to change notification settings - Fork 731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Layout: main panel resize #7
Comments
All event handlers are called before any changes applied to the object. It is done this way to allow events to be cancelable. However, if you need to execute a function after changes applied to the object you can do it this way: w2ui['layout'].on('resize', function(target, data) {
data.onComplete = function () {
var width = w2ui['layout'].get('main').width;
var height = w2ui['layout'].get('main').height;
console.log(width + 'x' + height);
}
}); You can read more about event flow here: http://w2ui.com/web/docs/utils/events |
You can attach event listeners to the panels, but there is no onResize for the panel, only entire layout. I have noticed, when layout is resized, main panel always resized and possibly some other panel (if it was not window resize). I have added data.panel variable to indicate what panel in addition to main was resized. Just checked into current working version. |
Thanks for you help! it's working now. It's not a continuous update, but it still sets the values after the resize operation has finished. |
Ok, as I don't use facebook, here is my comment: Great library, just what I was looking for: small, fast, easy to use, with a good set of widgets, a great layout system and MIT license. Was kind of hard to find, though, well, it's also very new. Keep up the good work!! |
Hi,
How do I get real-time size updates when the main panel in a layout is resized?
I'm currently rendering a three.js renderer into the main panel of a three panel layout. If the panels get resized the renderer needs to be resized as well, so I added a resize event listener:
However, during the resize the width and height values of the main panels do not change. I can only get a continuous width and height update of all other panels by attaching a 'resizing' event listener (here I get updates for, e.g., the left and right panel, depending which is getting resized).
Is there a better way to update the main panel content when the panels get resized?
And how do I attach event listeners to panels?
The text was updated successfully, but these errors were encountered: