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
Trigger overflow content check on setContent() #79
Comments
Hi @MicahBrown, There is a public method specially made for this case: var modal = new tingle.modal();
modal.open(); // modal content doesn't yet overflow the page at this point since it's blank
$.get('/ajax_content_url', function(response){
modal.setContent(response);
modal.checkOverflow();
}) In most cases, users set content first then open the modal. The checkOverflow() method needs an opened modal to work properly so I made this check in open() method. In other cases, you need to call checkOverflow() yourself. |
That may be so. I still think that checkOverflow should be called within
setContent since it's an entry point for new dynamic content. Don't you
think?
…On Tue, Mar 27, 2018, 6:06 AM Robin Parisi ***@***.***> wrote:
Hi @MicahBrown <https://github.com/MicahBrown>,
There is a public method specially made for this case:
var modal = new tingle.modal();modal.open(); // modal content doesn't yet overflow the page at this point since it's blank
$.get('/ajax_content_url', function(response){
modal.setContent(response);
modal.checkOverflow();
})
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#79 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEDXRopHCoVWjfy4Mo5JfhlixLfLCneyks5tih0YgaJpZM4S79fy>
.
|
In this case, it would be great to check if the modal is open before calling the checkOverflow method in setContent. |
@robinparisi I updated my PR. |
@MicahBrown Thanks, I've just merged your PR. It will be available in the next release. |
Sweet, thanks!
…On Tue, Mar 27, 2018, 12:15 PM Robin Parisi ***@***.***> wrote:
@MicahBrown <https://github.com/MicahBrown> Thanks, I've just merged your
PR. It will be available in the next release.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#79 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEDXRsuVUNrGsNm-_5FzaLwgriNzSj2-ks5tinO3gaJpZM4S79fy>
.
|
I'm appending ajax-ed content to the modal using
setContent()
. The issue is that the content is initially blank when the modal is opened and doesn't overflow the page. However, when the content is added, it overflows the page and the.tingle-modal--overflow
class is never added since it only triggers on window resize (as I can see), but notsetContent()
. I therefore cannot scroll with the content now overflowing the page.My work around looks something like this:
But I think
setContent()
should trigger theresize
event automatically.The text was updated successfully, but these errors were encountered: