forked from openemr/openemr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
topdialog.js
25 lines (22 loc) · 718 Bytes
/
topdialog.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright (C) 2005 Rod Roark <[email protected]>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
var modaldialog = null;
// called from onfocus handler of various documents:
function imfocused() {
if (modaldialog) {
if (modaldialog.closed) {
modaldialog = null;
} else {
if (window.focus) modaldialog.focus();
}
}
}
// call this from the top-level frameset's or body's onunload
function imclosing() {
if (modaldialog && ! modaldialog.closed) modaldialog.close();
modaldialog = null;
}