Changeset 5085


Ignore:
Timestamp:
Aug 28, 2009, 2:11:19 PM (13 years ago)
Author:
Nicklas Nordborg
Message:

References #1363: IE8 problems

Fixes a problem with detecting and handling an already opened window.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.13-stable/www/include/scripts/main.js

    r5084 r5085  
    7272    if (options == null) options = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes";
    7373    options = "top="+top+",left="+left+",width="+width+",height="+height+"," + options;
    74     var newWin = window.open('', name, options);
    75     if (newWin.isOld)
     74
     75    var newWin = this.getPageValue('open.windows', name);
     76    if (newWin && !newWin.closed)
    7677    {
    7778      var msg = 'This window has already been opened. ';
     
    8485      url += '&warnIfOpen=0';
    8586    }
    86     newWin.isOld = true;
    87     window.newWindow = newWin;
     87    var newWin = window.open('', name, options);
     88    this.setPageValue('open.windows', name, newWin);
    8889    Main.safeSetLocation(url, newWin, true);
    89     setTimeout("window.newWindow.focus()", 100);
    90   }
    91 
     90    setTimeout("Main.focusWindow('" + name + "')", 100);
     91  }
     92
     93  /**
     94    Brings a named window to focus.
     95  */
     96  this.focusWindow = function(windowName)
     97  {
     98    var win = this.getPageValue('open.windows', windowName);
     99    if (win) win.focus();
     100  }
     101 
    92102  /*
    93103    Opens a popupwindow with a larger textarea field. The text is taken from
Note: See TracChangeset for help on using the changeset viewer.