Forum LAMS for Tech-Heads - General Forum: Re: Re: Re: Why so many browser windows in LAMS 2?


 
Search: 

4: Re: Re: Re: Why so many browser windows in LAMS 2?
In response to 3 09/18/06 06:43 PM
[ Reply | Forward ]
Ken,

I'm confused.  I tried:

function openLearner( lessonId )
{
    if(isMac)
    {
        learnWin = window.open('home.do?method=learner&lessonID='+lessonId,'lWindow','width=796,height=570,resizable,status=yes');
    }
    else
    {
        alert("ken's case");
        window.open('home.do?method=learner&lessonID='+lessonId,'lWindow','width=796,height=570,resizable,status=yes')
    }
}

and I don't get any difference in behaviour in Firefox 1.5.0.6 - it still pops open a window.  I understood that you were trying to get it to open in a tab - if so then there must be something different in our Firefox settings.  Did I do the correct change to the code? Could you attach your updated openurls.js?

The code:

                    learnWin.location = 'home.do?method=learner&lessonID='+lessonId;
                    learnWin.focus();
                    document.location = 'home.do?method=learner&lessonID='+lessonId;

ensures that the window is updated with the new call and focus is switched to the window, to deal with cases where the popup window is already opened. We have to do this because we reuse the learner popup window everytime someone clicks on a lesson link, and if it gets hidden people just keep clicking on the link over and over again thinking that LAMS is broken because the window never appears.

So removing that code but staying with a popup window may leave people wondering where the learner window is - the worst of both worlds.

I'm not sure why we have a learnWin.location and document.location - this code is from 1.0.2 and was written so long ago I can't remember what the problem was that we were trying to work around.

Fiona

Posted by Fiona Malikoff

6: Re: Re: Re: Re: Why so many browser windows in LAMS 2?
In response to 4 09/20/06 06:40 AM
[ Reply | Forward ]
In 1.5.0.7 (I'm sure the version difference doesn't matter) I don't get a new window when I use the following.

By the way, it would be nice if somehow when you control-click you get a new tab (like FireFox and IE7) and otherwise you re-use the current window/tab. (Assuming the learning designer wants this.)

Best,

-ken

function openLearner( lessonId )
{
if(isMac)
{
learnWin = window.open('home.do?method=learner&lessonID='+lessonId,'lWindow','width=796,height=570,resizable,status=yes');
}
else
{
// updated by Ken Kahn on 180906
// if(learnWin && learnWin.open && !learnWin.closed )
// {
// learnWin.location = 'home.do?method=learner&lessonID='+lessonId;
// learnWin.focus();
document.location = 'home.do?method=learner&lessonID='+lessonId;
// }
// else
// {
// learnWin = window.open('home.do?method=learner&lessonID='+lessonId,'lWindow','width=796,height=570,resizable,status=yes');
// }
}
}

Posted by Ken Kahn

Reply to first post on this page
Back to LAMS for Tech-Heads - General Forum