Giter Site home page Giter Site logo

Comments (8)

limonte avatar limonte commented on May 11, 2024

I'm not sure how to implement this. Which bahaviour of gray overlay you're expecting - to fill only parent element?

from sweetalert2.

IvoPereira avatar IvoPereira commented on May 11, 2024

That's a good question, and that's another problem I've came up with, and I've not yet solved.

Well, it could be even more flexible and we could be able to specify which element we want the gray overlay to be, as in my case I would like to have the navigation menu overlayed, however it the alert should be centered to the content area.

from sweetalert2.

limonte avatar limonte commented on May 11, 2024

Sorry, but your case is pretty custom. You can fork SA2 and add that functionality to forked version of SA2.

from sweetalert2.

IvoPereira avatar IvoPereira commented on May 11, 2024

Thanks a lot anyway.

By the way, could you tell me how would you pass the extended params variable to the init function?

AFAIK init function is responsible for creating the main div in body, and it will be there that, according the params I would change the destination div, however, as init() is called once the page is loaded, I am not able to pass parameters to it.

What are your suggestions in this case?

Thanks!

from sweetalert2.

limonte avatar limonte commented on May 11, 2024

@IvoPereira take a look at e141f58

There's you can find the simple example of adding new params to SA2 and processing them in setParameters() method.

from sweetalert2.

IvoPereira avatar IvoPereira commented on May 11, 2024

I've successfully added some additional params and I am totally able to process them in modalDependant function.

However, as you in see here https://github.com/limonte/sweetalert2/blob/master/lib/sweetalert2.js#L491 - init function appends the sweet wrapper in body, however at this time I don't have the params defined, as they are just defined when swal() function is called in code.

Once document is ready, init function is called, and I am not able to pass any additional params - https://github.com/limonte/sweetalert2/blob/master/lib/sweetalert2.js#L763

from sweetalert2.

limonte avatar limonte commented on May 11, 2024

Yeah, you're right. You will need to refactor plugin to accept parameters before initialization. Not simple task, as I sensed :)

from sweetalert2.

IvoPereira avatar IvoPereira commented on May 11, 2024

Exactly what I tought!

Thanks a lot for your support @limonte!

from sweetalert2.

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.