summaryrefslogtreecommitdiff
path: root/kvmd/web/js/ui.js
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2018-08-13 08:36:52 +0300
committerDevaev Maxim <[email protected]>2018-08-13 08:36:52 +0300
commit8bd515b18dee4592ed53c9b90f503ec561604a17 (patch)
tree9d41a8b3ce5115a55360852c6de7b42abb9c1ad6 /kvmd/web/js/ui.js
parentb79b7e3975e9414b681c7511d7b5742ea6056320 (diff)
fixed stream window centering
Diffstat (limited to 'kvmd/web/js/ui.js')
-rw-r--r--kvmd/web/js/ui.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/kvmd/web/js/ui.js b/kvmd/web/js/ui.js
index c1e3cfc5..a2902395 100644
--- a/kvmd/web/js/ui.js
+++ b/kvmd/web/js/ui.js
@@ -1,10 +1,12 @@
function Ui(hid) {
+ var self = this;
+
+ /********************************************************************************/
+
var __top_z_index = 0;
var __windows = [];
var __ctl_items = [];
- /********************************************************************************/
-
var __init__ = function() {
Array.prototype.forEach.call($$("ctl-item"), function(el_item) {
el_item.onclick = () => __toggleMenu(el_item);
@@ -56,16 +58,16 @@ function Ui(hid) {
window.onmouseup = __globalMouseButtonHandler;
// window.oncontextmenu = __globalMouseButtonHandler;
- $("show-about-button").onclick = () => __showWindow($("about-window"));
- $("show-keyboard-button").onclick = () => __showWindow($("keyboard-window"));
- $("show-stream-button").onclick = () => __showWindow($("stream-window"));
+ $("show-about-button").onclick = () => self.showWindow($("about-window"));
+ $("show-keyboard-button").onclick = () => self.showWindow($("keyboard-window"));
+ $("show-stream-button").onclick = () => self.showWindow($("stream-window"));
- __showWindow($("stream-window"));
+ self.showWindow($("stream-window"));
};
/********************************************************************************/
- var __showWindow = function(el_window) {
+ self.showWindow = function(el_window) {
if (!__isWindowOnPage(el_window) || el_window.hasAttribute("data-centered")) {
var view = __getViewGeometry();
var rect = el_window.getBoundingClientRect();