summaryrefslogtreecommitdiff
path: root/web/share/js/wm.js
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2022-02-21 04:18:15 +0300
committerMaxim Devaev <[email protected]>2022-02-21 04:18:15 +0300
commit96191a1b0809a62e5b14316190c3de46b05d9ec2 (patch)
tree6a1e6238ecb6fad8ce78f644af99c73533fbbe30 /web/share/js/wm.js
parent67839a52a22a4e470109d3d0c8acf4798843bcf6 (diff)
ocr
Diffstat (limited to 'web/share/js/wm.js')
-rw-r--r--web/share/js/wm.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/web/share/js/wm.js b/web/share/js/wm.js
index 78a22140..823272d8 100644
--- a/web/share/js/wm.js
+++ b/web/share/js/wm.js
@@ -84,10 +84,7 @@ function __WindowManager() {
let el_close_button = el_window.querySelector(".window-header .window-button-close");
if (el_close_button) {
el_close_button.title = "Close window";
- tools.el.setOnClick(el_close_button, function() {
- __closeWindow(el_window);
- __activateLastWindow(el_window);
- });
+ tools.el.setOnClick(el_close_button, () => self.closeWindow(el_window));
}
let el_maximize_button = el_window.querySelector(".window-header .window-button-maximize");
@@ -139,6 +136,7 @@ function __WindowManager() {
/************************************************************************/
+ self.info = (...args) => __modalDialog("Info", args.join(" "), true, false, null);
self.error = (...args) => __modalDialog("Error", args.join(" "), true, false, null);
self.confirm = (...args) => __modalDialog("Question", args.join(" "), true, true, null);
@@ -253,6 +251,11 @@ function __WindowManager() {
};
};
+ self.closeWindow = function(el_window) {
+ __closeWindow(el_window);
+ __activateLastWindow(el_window);
+ };
+
var __closeWindow = function(el_window) {
el_window.focus();
el_window.blur();
@@ -460,6 +463,10 @@ function __WindowManager() {
var __makeWindowMovable = function(el_window) {
let el_header = el_window.querySelector(".window-header");
let el_grab = el_window.querySelector(".window-header .window-grab");
+ if (el_header === null || el_grab === null) {
+ // Для псевдоокна OCR
+ return;
+ }
let prev_pos = {x: 0, y: 0};