-
Notifications
You must be signed in to change notification settings - Fork 1
/
ClosePopup.js
24 lines (23 loc) · 1.16 KB
/
ClosePopup.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
// Keep these lines for a best effort IntelliSense of Visual Studio 2017 and higher.
/// <reference path="./../Packages/Beckhoff.TwinCAT.HMI.Framework.12.752.0/runtimes/native1.12-tchmi/TcHmi.d.ts" />
(function (/** @type {globalThis.TcHmi} */ TcHmi) {
var Functions;
(function (/** @type {globalThis.TcHmi.Functions} */ Functions) {
var Popups;
(function (Popups) {
function ClosePopup(Control) {
if (Control.getType().indexOf('UserControl') > -1) {
Control.getParent().destroy();
} else if (Control.getType().indexOf('Content') > -1) {
Control.getParent().destroy();
}
var PopUpTopMostLayer = TcHmi.Controls.get('PopUpTopMostLayer');
if (PopUpTopMostLayer) {
PopUpTopMostLayer.destroy();
}
}
Popups.ClosePopup = ClosePopup;
})(Popups = Functions.Popups || (Functions.Popups = {}));
Functions.registerFunctionEx('ClosePopup', 'TcHmi.Functions.Popups', Popups.ClosePopup);
})(Functions = TcHmi.Functions || (TcHmi.Functions = {}));
})(TcHmi);