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

Unable set Modaal width or height #27

Closed
suyashbansal opened this issue Apr 30, 2016 · 5 comments
Closed

Unable set Modaal width or height #27

suyashbansal opened this issue Apr 30, 2016 · 5 comments

Comments

@suyashbansal
Copy link

suyashbansal commented Apr 30, 2016

I am not able to set width or height of the modal by both default as well as inline attribute method. I tried this:
<script type="text/javascript"> $('.modaal-inline').modaal({ type: 'inline', accessible_title: 'Modal title', width: '400', height: '200' }); </script>
and also this
<a href="#inline-content" data-modaal-type="inline" data-modaal-width="200px" data-modaal-accessible-title="Inline Dialog Window" data-modaal-overlay-opacity="0.4" class="modaal">Show Modaal</a>

Am I doing it wrong?

@cbotman
Copy link
Contributor

cbotman commented May 2, 2016

Hey @suyashbansal, it looks like the width and height properties only affect iframe modals, at the moment.

@danhumaan This looks like a bug to me, or is the intent that you use CSS to control the modal content, including its dimensions? In that case, we should update the documentation at least.

@jackbarham
Copy link

jackbarham commented May 2, 2016

I've noticed this problem as well - I need to be able to set the width of all all modals, but this is not working:

$('.modal-show-alert').modaal({
    type: 'confirm',
    width: 480
});

@cbotman
Copy link
Contributor

cbotman commented May 3, 2016

Hi @suyashbansal and @jackbarham, until @danhumaan's has a chance to look at this, you can hopefully achieve what you need with this CSS (just ensure it's applied after modal.css is included).

Just confirmation dialogs:
.modaal-confirm .modaal-container { width: 400px; height: 200px; }

Or all modals:
.modaal-container { width: 480px; }

It looks like in our own projects we've been using CSS to control the modal sizes like that, which is likely how we missed the potential issue setting it via JavaScript.

@danhumaan
Copy link
Collaborator

Hi @suyashbansal and @jackbarham, an extension for width and height support has been worked in this morning and will become available in the next milestone release (0.3.0). For the width attribute, this will work as a css max-width so as keep it responsive. Height will work as a fixed height with overflow: auto applied so that any content within will scroll within that space.

For all reading this, width and height options are only applicable to the Inline, Ajax, iFrame and Confirm content types. It makes no sense to support modals that are fullscreen, video, instagram or image types as they are all responsive and designed to fill as much space as the content will allow for.

@danhumaan
Copy link
Collaborator

Hi @suyashbansal and @jackbarham, thanks again for your contributions. A fix has been just been rolled out in the latest release for this issue.

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

No branches or pull requests

4 participants