-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.js
42 lines (36 loc) · 1.17 KB
/
utils.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Declare the dock and undock event handlers.
System.Gadget.onDock = CheckDockState;
System.Gadget.onUndock = CheckDockState;
function CheckDockState() {
var oGadgetUndocked = document.getElementById("undocked");
var oGadgetDocked = document.getElementById("docked");
var oBody = document.body.style;
if (System.Gadget.docked) {
oBody.width = 150;
oBody.height = 150;
oGadgetUndocked.style.display = "none";
oGadgetDocked.style.display = "block";
}
else {
oBody.width = 450;
oBody.height = 150;
oGadgetUndocked.style.display = "block";
oGadgetDocked.style.display = "none";
}
RepositionText(System.Gadget.docked);
}
function RepositionText(docked) {
var oGadgetText = document.getElementById("XPCountdown");
var top = "90px";
var width = "150px";
if (docked) {
oGadgetText.style.top = top;
oGadgetText.style.left = "0px";
oGadgetText.style.width = width;
}
else {
oGadgetText.style.top = top;
oGadgetText.style.left = "300px";
oGadgetText.style.width = width;
}
}