var toggleModal = function (b) {
+
+ if (modalShowing && b) return;
+ if (!modalShowing && !b) return;
html.className=modalShowing?'':'modal';
- modalShowing = b;
+ modalShowing = !modalShowing;
if (modalShowing) {
dialog.focus();
}
.md-dialog {
- background:white;
- border:2px solid #800;
+ background: white;
+ border: 2px solid #800;
+ padding: 10px;
}
<body>
<center>
<h1><a href="termquit"><img src="static/logoff_32x.gif" border="0"> <?_("Log off")></a></h1>
-<h1><a href="javascript:toggleModal(false);"><img src="static/closewindow.gif" height="32" width="32" border="0"> <?_("Cancel")></a></h1>
+<h1><a href="javascript:toggleModal(0);"><img src="static/closewindow.gif" height="32" width="32" border="0"> <?_("Cancel")></a></h1>
</center>
</body>
</html>
modal dialog was invoked without first populating its contents, which
is a mistake.
<br>
-<h2><a href="javascript:toggleModal();">Dismiss</a></h2>
+<h2><a href="javascript:toggleModal(0);">Dismiss</a></h2>
</div>
</div>
<script type="text/javascript">
function PopUpFailed() {
- $('md-content').innerHTML = "<div align='justify'><?_("You have one or more instant messages waiting, but the Citadel Instant Messenger window failed to open. This is probably because you have a popup blocker installed. Please configure your popup blocker to allow popups from this site if you wish to receive instant messages.")></div><br><br><div align='center'><h2><a href='javascript:toggleModal(false);'>OK</a></h2></div>";
- toggleModal(true);
+ $('md-content').innerHTML = "<div align='justify'><?_("You have one or more instant messages waiting, but the Citadel Instant Messenger window failed to open. This is probably because you have a popup blocker installed. Please configure your popup blocker to allow popups from this site if you wish to receive instant messages.")></div><br><br><div align='center'><h2><a href='javascript:toggleModal(0);'>OK</a></h2></div>";
+ toggleModal(1);
}
</script>
{
method: 'get',
onSuccess: function(cl_success) {
- toggleModal(true);
+ toggleModal(1);
}
}
);