| 419 | | /* FIXME: I think this is to stop the popup from running off the bottom of the screen? |
| 420 | | var dx = x + div.offsetWidth - window.innerWidth + 4; |
| 421 | | var dy = y + div.offsetHeight - window.innerHeight + 4; |
| 422 | | // alert('dy= (' + y + '+' + div.offsetHeight + '-' + window.innerHeight + ' + 4 ) = ' + dy); |
| 423 | | if (dx > 0) x -= dx; |
| 424 | | if (dy > 0) y -= dy; |
| 425 | | */ |
| 426 | | div.style.left = x + "px"; |
| 427 | | div.style.top = y + "px"; |
| | 421 | /* keep then menu from overflowing the client window boundaries */ |
| | 422 | |
| | 423 | /* provide a virtual margin to leave a swoosh of air between the |
| | 424 | meny and the window edge. This should probably go into the menu |
| | 425 | container css as margin 10px instead... |
| | 426 | */ |
| | 427 | var margin = 10; |
| | 428 | |
| | 429 | if (y + div.offsetHeight + margin > window.innerHeight) |
| | 430 | y = window.innerHeight - div.offsetHeight - margin; |
| | 431 | if (x + div.offsetWidth + margin > window.innerWidth) |
| | 432 | x = window.innerWidth - div.offsetWidth - margin; |
| | 433 | |
| | 434 | div.style.left = x + "px"; |
| | 435 | div.style.top = y + "px"; |
| | 436 | div.style.visibility = "visible"; |
| | 437 | |