Giter Site home page Giter Site logo

Comments (9)

nikku avatar nikku commented on July 25, 2024

Do you think this is desirable? I would suggest to use a normal webpage to display extra large content, e.g. tables.

from jquery-bootstrap-scripting.

syphernl avatar syphernl commented on July 25, 2024

Well, maybe make it optional or add a max-width to it.

In my case I had to widen the default modals because they were not wide enough for a simple form element row: "{label} {input field} {fairly long suffix that was too wide by default}".

I believe Facebox does the same thing. I was using this prior to finding this library (after spending 1-2h on making it work with Bootstrap :-))

from jquery-bootstrap-scripting.

nikku avatar nikku commented on July 25, 2024

Well, it is rather easy to change that, maybe consider to do it on your own. Override the boostrap styles for .modal which are

.modal {
    ...
    width: 560px;
    top: 50%;
    margin: -250px 0 0 -250px;
}

with your new styles for wide dialogs

.wide-modal {
    ...
    top: 20%;
    width: 800px;
    margin: 0 0 0 -400px; /* -1 * (width / 2) */ 
}

from jquery-bootstrap-scripting.

syphernl avatar syphernl commented on July 25, 2024

But how would you determine which modals are normal, and which are wide? That probably involves an additional class next to open-modal, doesn't it?

from jquery-bootstrap-scripting.

nikku avatar nikku commented on July 25, 2024

Could you tell me, what your precise use case is for the wide dialog is? How do you want it to be configurable?

The above example can be applied by giving a modal dialogs parent the new class name, e.g. by executing $(".selector").parent().addClass("wide-modal").

from jquery-bootstrap-scripting.

syphernl avatar syphernl commented on July 25, 2024

In some cases, my forms are too wide to fit in the default modals, so in those cases I'd like to be able to override that per modal.

from jquery-bootstrap-scripting.

syphernl avatar syphernl commented on July 25, 2024

Your code sample works as a charm.
There is no need to change the margins though, atleast not in my case.

You might want to add this to the documentation.

from jquery-bootstrap-scripting.

andreslucena avatar andreslucena commented on July 25, 2024

+1 to adding this to the documentation, it's a nice trick :)

from jquery-bootstrap-scripting.

nikku avatar nikku commented on July 25, 2024

Added to docs ;-)

from jquery-bootstrap-scripting.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.