» Forums
» DynarchMenu forum
» Bug reports
» DynarchMenu.setup restores minimized browser window
DynarchMenu.setup restores minimized browser window
2007/04/19 20:15
Viewed 3768 times
Replies: 0/0

The DynarchMenu component restores a minimized IE6 browser window when DynarchMenu.setup is called.

We have search results that get refreshed at a set interval via an AJAX call. The returned results have elements that use Dynarch context menus, so we call DynarchMenu.setup after adding the results of the AJAX call to the DOM. Our problem occurs when the browser is minimized and the AJAX call returns, kicking off a call to DynarchMenu.setup. This causes the minimized window to be restored, interupting whatever the user may have been doing in another window.

This problem is not AJAX related as it can be reproduced in the following code.

<html>
<head>
<title>Window focus test</title>
<!--BEGIN Setup Dynarch menu-->
<style type="text/css">@import url("hmenu/skin-xp.css");</style>
<script type="text/javascript">_dynarch_menu_url = "hmenu/";</script>
<script type="text/javascript" src="hmenu/hmenu.js"></script>
<!--END Setup Dynarch menu-->

<script type="text/ecmascript">
var i = 10;
var intervalId;
var countDownDiv;
function startCountDown()
{
countDownDiv = document.getElementById('countDownDiv');
countDownDiv.onclick = null;
countDownDiv.style.cursor = '';
intervalId = setInterval(countDown, 1000);
}

function countDown()
{
i--;
if (i === 0)
{
clearInterval(intervalId);
setContextMenu();
}
else
{
countDownDiv.innerText = i + ' seconds until context menu setup. Please minimize browser window.';
}
}

function setContextMenu()
{
DynarchMenu.setup('menu', { context: true });
countDownDiv.innerText = 'Right-click here.';
}
</script>
</head>
<body>
<div onclick="startCountDown()" id="countDownDiv" style="cursor: pointer;">Click here to start count down.</div>
<div style="display: none;">
<ul id="menu">
<li class="context-for-countDownDiv">
<ul>
<li>Foo Bar item 1 </li>
<li>Foo Bar item 2 </li>
</ul>
</li>
</ul>
</div>
</body>
</html>

Google