X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fstatic%2Fmodal.js;h=bd5de79603a410be1170662a92ad70ea61df111f;hb=b7f1665b64318cee1b14d13f7e9fdb6a323189a4;hp=f12aed2252a13474c82c27c4acfce0915d128c03;hpb=8a8f7014e340e653af6e42480b604de611ea7e56;p=citadel.git diff --git a/webcit/static/modal.js b/webcit/static/modal.js index f12aed225..bd5de7960 100644 --- a/webcit/static/modal.js +++ b/webcit/static/modal.js @@ -69,10 +69,15 @@ if ( isSafari ) { // need to do some special stuff to handle MSIE. -var toggleModal = function () { +var toggleModal = function (b) { + + if (modalShowing && b) return; + if (!modalShowing && !b) return; html.className=modalShowing?'':'modal'; + modalShowing = !modalShowing; + if (modalShowing) { dialog.focus(); } else if (focusedElement) {