mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 17:20:30 +08:00
fixed stream window centering
This commit is contained in:
parent
b79b7e3975
commit
8bd515b18d
@ -1,6 +1,6 @@
|
||||
function main() {
|
||||
var hid = new Hid();
|
||||
var ui = new Ui(hid);
|
||||
new Session(new Atx(), hid, new Msd());
|
||||
new Stream();
|
||||
new Ui(hid);
|
||||
new Stream(ui);
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
function Stream() {
|
||||
function Stream(ui) {
|
||||
// var self = this;
|
||||
|
||||
/********************************************************************************/
|
||||
@ -69,6 +69,7 @@ function Stream() {
|
||||
var el_stream_image = $("stream-image");
|
||||
el_stream_image.style.width = __normal_size.width * __size_factor + "px";
|
||||
el_stream_image.style.height = __normal_size.height * __size_factor + "px";
|
||||
ui.showWindow($("stream-window"));
|
||||
};
|
||||
|
||||
var __refreshImage = function() {
|
||||
|
||||
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user