dotnetic Posted September 9, 2019 Share Posted September 9, 2019 @ryanI have an open pw-panel, and now I want to close itself via JavaScript from inside the panel. How would I do that? Link to comment Share on other sites More sharing options...
dotnetic Posted September 10, 2019 Author Share Posted September 10, 2019 Ok, I found one solution but I don't know if it is the smartest way: $('#pw-panel-shade', window.parent.document).click(); Link to comment Share on other sites More sharing options...
bernhard Posted September 10, 2019 Share Posted September 10, 2019 7 hours ago, jens.martsch said: $('#pw-panel-shade', window.parent.document).click(); I think that's the best solution and I can't think of any problems using it ? 1 Link to comment Share on other sites More sharing options...
kongondo Posted September 10, 2019 Share Posted September 10, 2019 (edited) Edit: I misunderstood the question above...this post is not really relevant but I'll leave it here anyway :-). This is how I close PW modals (in Media Manager and other modules). /** * Close jQuery UI Modal. * * @param integer $s Number of milliseconds before closing modal. * */ function closeDialog($s = 1000) { setTimeout(function() { jQuery('iframe.ui-dialog-content').dialog('close'); }, $s); } // call the function // if adding media into a Media Manager Inputfield and closing the dialog is set // in this case data is an Ajax Response if (action === "insert" && data.insertAndClose) closeDialog(); Question, are pw-panels the same as pw modals? Edited September 10, 2019 by kongondo 1 Link to comment Share on other sites More sharing options...
dragan Posted September 10, 2019 Share Posted September 10, 2019 42 minutes ago, kongondo said: Question, are pw-panels the same as pw modals? No, panels are the ones that slide in from left, and modals are like lightboxes. Link to comment Share on other sites More sharing options...
bernhard Posted September 10, 2019 Share Posted September 10, 2019 1 hour ago, kongondo said: Question, are pw-panels the same as pw modals? https://processwire.com/blog/posts/building-custom-admin-pages-with-process-modules/#using-internal-components-modules Link to comment Share on other sites More sharing options...
kongondo Posted September 10, 2019 Share Posted September 10, 2019 24 minutes ago, dragan said: No, panels are the ones that slide in from left, and modals are like lightboxes. 2 minutes ago, bernhard said: https://processwire.com/blog/posts/building-custom-admin-pages-with-process-modules/#using-internal-components-modules Thanks both. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now