Jump to content

How do I close a pw-panel via script?


dotnetic
 Share

Recommended Posts

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 by kongondo
  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...