Skip to content
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

fit, flow & reposition (clear mess up history) #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jojosati
Copy link

@jojosati jojosati commented Mar 8, 2013

sorry for previous pull request.

this branch has cleared some messed up historty

and submit only the fit, flow & reposition code.

@jordandh
Copy link

Hey @jojosati I took a look at your pull request and saw that you are listening to the change event in order to reapply the layout on the modal. Why do you listen to the change event when that event is fired by input elements? As a user of the fit/flow/reposition features you added am I expected to fire a change event on the modal element when I want it to reapply the layout? If so it seems like I could just call the layout method myself.

Can you clear things up for me?

@jojosati
Copy link
Author

I think there are 2 ways to detect the modal size changing.

  • polling, this may consume the processor.
  • programatic trigger, programer will know where and when to do.

When using modal as popup input form, change event can bubble to the modal automaticly.

At first time I am using modal this way, so I choose the change event because it consume less processor than polling.

Example In my form I have a checkbox for "more option" to collapse/expand some less use inputs.
Changing state in this checkbox can trigger the modal to checking whether it's size has changed.

modal-form-explain-01

modal-form-explain-02

When using modal as ajax container, need programatic trigger when finish loading and apply data to the modal.

When using modal as interactive content - collapsable, resizable or toggle hide/show some elements. Leave it to programatice trigger.

Change event does some checkings and optimizations before layout invoke,

  1. Wait for a while, (some transition like fade in / fade out needs a bit time to finish)
  2. Checking whether actual modal size differs from last layout called.
  3. Only size change detected will call layout to minimum the screen flicker problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants