You need to sign in to do that
Don't have an account?
Javascript window.open() or SLDS Modal... I can't get either to work.
I am trying to create two popup windows. One contains an html page (dynamically created) as preview. The other is the bare html code, shown when the user wants to export the page.
The problem with the javascript popup window:
var mywindow = window.open("", "_blank" /* the rest of the arguments go here*/ ); mywindow.document.write("<p>some text</p>"); mywindow.close();
The problem with the above code is that it crashes on the second line, saying it doesn't know document.write.
If I comment out the second line, I see a window appearing very briefly before correctly dissapearing again.
The problem with modals, is that I simply cannot get them to work.
I can get them to apear (on init, not usefull either), but I cannot get them to hide either on clicking a button or on init.
(No code supplied because tried so many variations I don't know where to start, I guess if I had to choose the SLDS website's example).
Any advice on how to solve either problem?
(If I can solve both tasks with one type of popup I'm absolutely fine with using one method only.)
Thanks!
see the comment on my issue on Github. There is the workaround.
It involves adding and removing classes to make the modal appear and dissapear.
All Answers
thanks
The above code is a snippet with some buttons (you see two, but there's a lot more, but to keep the code clean I removed the others) embedded some layers in my app.
When I load it, the modal springs to life and I can't get it to go away.
I've tried component.find()-ing the div by using its label 'header43', I've tried adding an auraID and finding that, and then setting aira-hidden to true, but nothing would help - I couldn't get the modal to go away...
I put the modal here as the button you can see here (Export) is the one that's going to be activating the modal and then filling it, but if it has to go somewhere else I don't mind, I then will just send an event to the component where it's located and that will do the rest.
see the comment on my issue on Github. There is the workaround.
It involves adding and removing classes to make the modal appear and dissapear.