| 451 | | /* FIXME: I think this is to stop the popup from running off the bottom of the screen? |
| 452 | | var dx = x + div.offsetWidth - window.innerWidth + 4; |
| 453 | | var dy = y + div.offsetHeight - window.innerHeight + 4; |
| 454 | | // alert('dy= (' + y + '+' + div.offsetHeight + '-' + window.innerHeight + ' + 4 ) = ' + dy); |
| 455 | | if (dx > 0) x -= dx; |
| 456 | | if (dy > 0) y -= dy; |
| 457 | | */ |
| 458 | | div.style.left = x + "px"; |
| 459 | | div.style.top = y + "px"; |
| | 453 | /* keep then menu from overflowing the client window boundaries */ |
| | 454 | |
| | 455 | /* provide a virtual margin to leave a swoosh of air between the |
| | 456 | meny and the window edge. This should probably go into the menu |
| | 457 | container css as margin 10px instead... |
| | 458 | */ |
| | 459 | var margin = 10; |
| | 460 | |
| | 461 | if (y + div.offsetHeight + margin > window.innerHeight) |
| | 462 | y = window.innerHeight - div.offsetHeight - margin; |
| | 463 | if (x + div.offsetWidth + margin > window.innerWidth) |
| | 464 | x = window.innerWidth - div.offsetWidth - margin; |
| | 465 | |
| | 466 | div.style.left = x + "px"; |
| | 467 | div.style.top = y + "px"; |
| | 468 | div.style.visibility = "visible"; |
| | 469 | |