Fix close type

This commit is contained in:
Ximi1970
2023-08-05 10:46:33 +02:00
parent 3129f0de5b
commit 4fc3286d38
2 changed files with 10 additions and 2 deletions

View File

@@ -62,6 +62,8 @@ var windowListener = new (class extends ExtensionCommon.EventEmitter {
this.MESSAGE_CLOSE_TYPE_DEFAULT = 0;
this.MESSAGE_CLOSE_TYPE_MIN_MAIN_CLOSE_CHILDREN = 1;
this.MESSAGE_CLOSE_TYPE_MIN_ALL = 2;
this.MESSAGE_CLOSE_TYPE_MIN_MAIN_TRAY_CLOSE_CHILDREN = 3;
this.MESSAGE_CLOSE_TYPE_MIN_ALL_TRAY = 4;
this.closeType = this.MESSAGE_CLOSE_TYPE_MIN_MAIN_CLOSE_CHILDREN;
}
@@ -73,6 +75,10 @@ var windowListener = new (class extends ExtensionCommon.EventEmitter {
this.closeType = this.MESSAGE_CLOSE_TYPE_MIN_MAIN_CLOSE_CHILDREN;
} else if (closeType === 2) {
this.closeType = this.MESSAGE_CLOSE_TYPE_MIN_ALL;
} else if (closeType === 3) {
this.closeType = this.MESSAGE_CLOSE_TYPE_MIN_MAIN_TRAY_CLOSE_CHILDREN;
} else if (closeType === 4) {
this.closeType = this.MESSAGE_CLOSE_TYPE_MIN_ALL_TRAY;
} else console.log("Unknown close type: " + closeType);
}
@@ -91,7 +97,9 @@ var windowListener = new (class extends ExtensionCommon.EventEmitter {
if (
windowListener.callbackOnLoadWindowCount === 1 ||
windowListener.closeType ===
windowListener.MESSAGE_CLOSE_TYPE_MIN_ALL
windowListener.MESSAGE_CLOSE_TYPE_MIN_ALL ||
windowListener.closeType ===
windowListener.MESSAGE_CLOSE_TYPE_MIN_ALL_TRAY
) {
window.addEventListener(
"close",

View File

@@ -12,7 +12,7 @@
"type": "integer",
"name": "type",
"minimum": 0,
"maximum": 2
"maximum": 4
}
]
}