We are creating a GUI Extension which should open a popup. Based on some examples, we have placed the following code in Extensions.Tr.prototype._execute:
var popup = $popup.create(url, "toolbar=no,width=1000px,height=700px,resizable=false,scrollbars=false", null); popup.open();
url is the url of the application.
Our problem is that when someone clicks more than once on the icon of the GUI extension, the popup is opened more than once. We would like to avoid that.
So if a popup is already open, we wish to just the change its url, and not open a new popup.
How this can be achieved through passing some parameters (popup name, etc)?
Is there a way to do it with this kind of code?
var popup= window.open(url, "testName", "toolbar=no,width=1000px,height=700px,resizable=false,scrollbars=false", true); popup.focus();
where the second parameter is the name of the popup window, and the last parameter is set to true (true - URL replaces the current document in the history list).
I would like to make as much use as possible of standard Tridion code for this, and avoid writing too much custom code.