-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 #87
Conversation
height and maxHeight option can pass a callback function or string 'auto', for recalculating height/maxHeight of modal-body everytime window's size changed.
Modal with '.modal-reposition' class will listen to any input 'change' event to check modal-size changed and fire 'resize.modal'.
The "change" event may be triggered by input, select and textarea element within modal. Otherwise required writing a custom script to trigger when ajax loading complete or trigger every specific interval .
…bootstrap-modal/master
@@ -104,6 +104,11 @@ | |||
var prop = this.options.height ? 'height' : 'max-height', | |||
value = this.options.height || this.options.maxHeight; | |||
|
|||
if (!value && this.$element.hasClass('modal-fit')){ | |||
value = function(){return $(window).height() - 165} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the value 165 shouldn't be hardcoded if we're going to include the "contrain modal to window size" example from the docs. This wouldn't work quite right for all cases (i.e no header or footer, any font/padding style changes etc..)
Would be nice if we could compute the actual value. Something like windowHeight - headerHeight - footerHeight - marginBetweenModalAndWindow
.
For some reason I can't auto merge this PR but can #72 be closed? Seems like it contains both functionalities. |
I've just add the "Fit, Flow & Reposition" demo using my wip branch at last section of page.
http://jojosati.github.com/bootstrap-modal/demo.html