cdotyone / mochaui

development tree for MochaUI
http://mochaui.org/demo/
Other
290 stars 83 forks source link

Panel onResize #42

Open eerne opened 14 years ago

eerne commented 14 years ago

From the documentation of MUI.Panel: onResize (function) Fired when the panel is resized.

This is a bit misleading, since it only fires if the panel's handle is draged, but not:

One could use the MUI.Column onResize event, but there seems no generic way to get all the panels in this column.

Feature request:

See also: http://groups.google.com/group/mocha-ui/browse_thread/thread/f75fe7b409721237/3817cac884e267af AND http://groups.google.com/group/mocha-ui/browse_thread/thread/fad1e08b39ed1000/8b26dd4b1ee83de7?lnk=gst&q=resize+panel#8b26dd4b1ee83de7

mui-org commented 14 years ago

columnInstance.getPanels() to get all of the panel instances in that column

column resize now fires all panel resize events, and it will fire the resize on its partner column and of its panels

panel resize now fires its partner panel's resize event

check it out and let me know if it works like you expected

eerne commented 14 years ago

I will add a test for this one today (first CSS3 for windows).

eerne commented 14 years ago

Added display of width and height in the console panel http://github.com/eerne/mochaui/commit/0d731f9105591cf2fa8d97ecdea5fbf0c959eb2d

Works nicely so far. There are 2 more situation where onResize should fire (or eventually where we could add new events):

mui-org commented 14 years ago

Thanks for the look. I will work on the additional resize events.

mui-org commented 14 years ago

resize now fired on column and panels when browser window resizes resize now fired after a panel is dragged

eerne commented 14 years ago

Thank you, it works nicely!

eerne commented 14 years ago

One tiny convenience issue, the onResize event fires two times on load, after the content is loaded.

In my app however the two resize events are fired before the content is loaded. I couldn't reproduce that with the MochaUI demo, but I suppose it has to do something with requiring additional css and js in this panel, which postpones the content loaded event but still fires both resize.

In my case it would make sense if onResize does not fire on load at all. And the MochaUI demo could omit the if()'s in updateResizeElements. Is there any way to add the onResize events after onContentLoaded fires, without the resize to fire?

mui-org commented 14 years ago

I will look into this. We need to be able to check content is loaded before firing events.