Files
matrix/cygnus-onprem-app/build/WebContent/js/matrix-dialog-child.js

25 lines
637 B
JavaScript

(() => {
"use strict";
const nativeClose = window.close.bind(window);
window.MatrixDialog = {
isEmbedded() {
return window.parent && window.parent !== window;
},
close(result = 0) {
if (this.isEmbedded()) {
window.parent.postMessage({type: "matrix-dialog-close", result}, window.location.origin);
return;
}
window.returnValue = result;
nativeClose();
}
};
if (window.MatrixDialog.isEmbedded()) {
window.close = () => window.MatrixDialog.close(window.returnValue ?? 0);
}
})();