My favorites | Sign in
Project Home Downloads Issues
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 162: Reload Opener page on close
2 people starred this issue and may be notified of changes. Back to list
Status:  Invalid
Owner:  ----
Closed:  Feb 2009


 
Reported by megato...@gmail.com, Feb 12, 2009
What steps will reproduce the problem?
1. open a nyromodal
2. close the modal
3. the opener page reloads

What is the expected output? What do you see instead?
normally nothing happens on close the nyro, but i wanted to reload the 
opener page.

What version of the product are you using? On what operating system?
1.3.1+

Please provide any additional information below.

I addes some code to the original file:

new Setting at about Line 214 (1.4.0):
Reload: false, // Reloads the opener page on close if true

new From Setting for rev tag at about line 769(1.4.0):
if (jFrom.attr('rev') == 'reload')
	currentSettings.Reload = true;

added the Reload in the removeModal function at about line 1182:
if(currentSettings.Reload == true)				
	top.window.location.href = top.window.location;	

Feb 12, 2009
#1 megato...@gmail.com
sorry forgot the way to call:
class="nyroModal" rev="reload"

Feb 12, 2009
Project Member #2 nyro...@gmail.com
Instead of hacking nyroModal, it could be so much better if you're using the callback
created to do that.
In your case, it will be endRemove:
$.nyroModalSettings({
	endRemove: function(elts, settings) {
		top.window.location.href = top.window.location;
	}
});
Status: Invalid
Feb 12, 2009
#3 megato...@gmail.com
But i dont want to reload EVERY modal opener on close, but only these i tagged 
with "reload".
Your example would affect ALL my modals didnt it?
Feb 12, 2009
Project Member #4 nyro...@gmail.com
use this code instead:
$.nyroModalSettings({
	endRemove: function(elts, settings) {
		if ($(settings.from).attr('rev') == 'reload')
			top.window.location.href = top.window.location;
	}
});

Feb 12, 2009
#5 megato...@gmail.com
THX that works exactly the way I wanted to.

I just expanded it a little bit, so you can go to a different location than the 
opener page:

$.nyroModalSettings({
	endRemove: function(elts, settings) {
			if ($(settings.from).attr('rev').match(/reload/))
				tempUrl = $(settings.from).attr('rev').split(':');
					if(tempUrl.length>1){
					top.window.location.href = "http:// + 
top.window.location.hostname + "/" + tempUrl[1];
					}else{
					top.window.location.href = 
top.window.location;
					}
			}
		});

call with: rev="reload:file.php"
Feb 12, 2009
Project Member #6 nyro...@gmail.com
ok, that's fine.

Powered by Google Project Hosting