Jump to content
Jens Martsch - dotnetic

How do I close a pw-panel via script?

Recommended Posts

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 🙂 

  • Like 1

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...