forked from openemr/openemr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New dialog implementation-continued. (openemr#1307)
* New dialog implementation-continued. * travis fix. * addressed code review. * travis * another dialog update * Disclosure save redo for browser compatibility. * travis
- Loading branch information
Showing
37 changed files
with
592 additions
and
445 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,17 +22,56 @@ | |
* @author Jerry Padgett <[email protected]> | ||
* @link http:https://www.open-emr.org | ||
*/ | ||
// Reworked to be used in both frmes and tabs u.i.. sjp 12/01/17 | ||
|
||
// Reworked to be used in both frames and tabs u.i.. sjp 12/01/17 | ||
// Removed legacy dialog support. sjp 12/16/17 | ||
// All window.close() should be removed from scripts and replaced with dlgclose() where possible | ||
// usually anywhere dlgopen() is used. Also, top.dlgclose and parent.dlgclose() is available. | ||
// | ||
if (!opener) { | ||
opener = top.get_opener(window.name); | ||
} | ||
|
||
window.close = | ||
function () { | ||
function (call, args) { | ||
var frameName = window.name; | ||
var wframe = opener; | ||
if (!top.tab_mode) { | ||
for (; wframe.name !== 'RTop' && wframe.name !== 'RBot'; wframe = wframe.parent) { | ||
if (wframe.parent === wframe) { | ||
wframe = window; | ||
} | ||
} | ||
for (let i = 0; wframe.document.body.localName !== 'body' && i < 4; wframe = wframe[i++]) { | ||
if (i === 3) { | ||
console.log("Opener: unable to find modal's frame"); | ||
return false; | ||
} | ||
} | ||
dialogModal = wframe.$('div#' + frameName); | ||
} else { | ||
var dialogModal = top.$('div#' + frameName); | ||
wframe = top; | ||
} | ||
|
||
var removeFrame = dialogModal.find("iframe[name='" + frameName + "']"); | ||
if (removeFrame.length > 0) { | ||
removeFrame.remove(); | ||
} | ||
|
||
if (dialogModal.length > 0) { | ||
if(call){ | ||
wframe.setCallBack(call, args); | ||
} | ||
dialogModal.modal('hide'); | ||
} | ||
|
||
}; | ||
|
||
var dlgclose = | ||
function (call, args) { | ||
var frameName = window.name; | ||
var wframe = opener; | ||
if (!top.tab_mode) { | ||
let wframe = opener; | ||
for (; wframe.name !== 'RTop' && wframe.name !== 'RBot'; wframe = wframe.parent) { | ||
if (wframe.parent === wframe) { | ||
wframe = window; | ||
|
@@ -46,16 +85,20 @@ window.close = | |
} | ||
dialogModal = wframe.$('div#' + frameName); | ||
} else { | ||
var dialogModal = top.$('div#' + frameName); // This is a dynamic div. | ||
var dialogModal = top.$('div#' + frameName); | ||
wframe = top; | ||
} | ||
|
||
var removeFrame = dialogModal.find("iframe[name='" + frameName + "']"); | ||
if (removeFrame.length > 0) { | ||
removeFrame.remove(); | ||
} | ||
var dialogDiv = top.$("#dialogDiv"); | ||
var body = top.$("body"); | ||
var removeFrame = body.find("iframe[name='" + frameName + "']"); | ||
removeFrame.remove(); | ||
if (body.children("div.dialogIframe").length === 0) { | ||
dialogDiv.hide(); | ||
}; | ||
if (dialogModal.length > 0) { // Will let modal's hidden event clean up. | ||
|
||
if (dialogModal.length > 0) { | ||
if(call){ | ||
wframe.setCallBack(call, args); | ||
} | ||
dialogModal.modal('hide'); | ||
}; | ||
} | ||
|
||
}; |
Oops, something went wrong.