popup

Hi Clifton,
Using your code I did this:
action = 1 creates the window
action = 2 refocuses it
action = 3 closes it
The problem is that 2 only works if the window exists. I want to recreate it if it has been closed inadvertently but although I spent hours I can't find a solution. Could you have a look please if you have time?
PS Firefox is also playing up like Chrome now. asking me to login again before I can send this. This time I've copied it so it should be OK.
John
Using your code I did this:
- Code: Select all
function tbfunction_smallPopup(url, alignToName, action)
{
var bds = { align : '', page : '', screen : '', titlebar : ''}, adj = 2, pos;
if (alignToName) {
bds.align = tbfunction_pgTBObjGet(alignToName, 'bounds').split(',');
}
bds.page = tbfunction_pgTBObjGet('page', 'bounds').split(',');
bds.screen = [window.screenX, window.screenY, window.outerHeight, window.innerHeight];
bds.titlebar = bds.screen[2] - bds.screen[3];
pos = [ bds.align[0]*1 + bds.page[0]*1 + bds.screen[0]-adj,
bds.align[1]*1 + bds.page[1]*1 + bds.screen[1] + bds.titlebar-adj*2,
bds.align[2], bds.align[3] - Math.round(bds.titlebar/2.65)*2 ];
if (action == 1)
{
tbfunction_pgGotoURL("RefWindow", url, pos[0], pos[1], pos[2], pos[3], "", "scrollbars=1", true, true);
}
else if (action == 2)
{setTimeout(window.open('', 'RefWindow').focus(), 1);
// var c = window.open('', 'RefWindow').closed;
// if (c == false)
// {
// setTimeout(window.open('', 'RefWindow').focus(), 1);
// }
// else
// {
// tbfunction_pgTimer(false, "save", 500);
// }
}
else if (action == 3)
{
window.open('', 'RefWindow').close();
}
};
action = 1 creates the window
action = 2 refocuses it
action = 3 closes it
The problem is that 2 only works if the window exists. I want to recreate it if it has been closed inadvertently but although I spent hours I can't find a solution. Could you have a look please if you have time?
PS Firefox is also playing up like Chrome now. asking me to login again before I can send this. This time I've copied it so it should be OK.
John