Comments (8)
I'm not sure how to implement this. Which bahaviour of gray overlay you're expecting - to fill only parent element?
from sweetalert2.
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.
Sorry, but your case is pretty custom. You can fork SA2 and add that functionality to forked version of SA2.
from sweetalert2.
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.
@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.
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.
Yeah, you're right. You will need to refactor plugin to accept parameters before initialization. Not simple task, as I sensed :)
from sweetalert2.
Exactly what I tought!
Thanks a lot for your support @limonte!
from sweetalert2.
Related Issues (20)
- If you have the right to ask I have the right to ask back: Could you update your support from Ukraine to Palestine? HOT 1
- Please drop your protest ware issue HOT 2
- Copy to clipboard content button HOT 1
- Autor - YOU NAZI HOT 3
- no patch yet for package audit HOT 1
- In earlier versions of Chrome (e.g. Chrome87) pop-ups are not normal. HOT 1
- sweet alert break background layout. HOT 2
- Circle animation for success icon breaks when timing exceeds 4 seconds HOT 1
- Icons invisible with colored-toast HOT 2
- Timer doesn't seem to be working HOT 1
- Can u also update the integrations with js frameworks? HOT 1
- isVisible not false in .then() HOT 2
- Option for Page Scrolling HOT 4
- How can we add Angular component in sweetalert.
- .NET 8 Blazor - Error: There are multiple .NET runtimes present HOT 3
- support russia HOT 2
- Input Types - Email HOT 3
- Wave Tool accessibility errors SweetAlert2 HOT 1
- Partial<SweetAlertOptions> not working when using spreading operator HOT 1
- showLoaderOnConfirm not showing loader HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sweetalert2.