forked from openfin/java-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlayout.html
More file actions
39 lines (34 loc) · 1.37 KB
/
layout.html
File metadata and controls
39 lines (34 loc) · 1.37 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<html>
<head>
<title>Openfin Layouts Included</title>
<script src="https://cdn.openfin.co/services/openfin/layouts/1.0.0/openfin-layouts.js"></script>
<script type="text/javascript">
window.addEventListener("DOMContentLoaded", function() {
OpenFinLayouts.snapAndDock.addEventListener('window-docked', e => {
let undock = document.getElementById("undock");
undock.disabled = false;
});
OpenFinLayouts.snapAndDock.addEventListener('window-undocked', e => {
let undock = document.getElementById("undock");
undock.disabled = true;
});
});
function undockMe() {
OpenFinLayouts.snapAndDock.undockWindow();
}
</script>
</head>
<body style="background-color: rgb(158, 240, 222);">
<script>
const randomColor = () => {
return '#' + ((1 << 24) * Math.random() | 0).toString(16);
};
document.addEventListener('DOMContentLoaded', () => {
document.body.style.backgroundColor = randomColor();
});
</script>
<p>Openfin Layouts Library is included via script tag in this window. Accessible with global var OpenfinLayouts</p>
<div>
<Button id="undock" disabled onclick="undockMe()"> Undock </Button>
</div>
</body></html>