Merge branch 'master' of gitee.com:xenkuo/comNG

This commit is contained in:
Xen 2020-05-19 22:11:52 +08:00
commit 9d8e8e2476
1 changed files with 11 additions and 6 deletions

View File

@ -266,17 +266,22 @@ document.onkeydown = function (e) {
}
};
// prevent text select for double click action
// Note: all click event is eaten by system for drag element on Windows,
// so, nav-area mousedown and dbclick event can't be captured by below code
// For drag region which nav-area is, the behavior is different between Mac and Windows/Debian:
// On Windows/Debian a drag region is take a system title bar, and all event is captured by
// system, app can't get any click or mouse event. At the same time, double click event
// will resize app window by system, no need for app to implement such function.
// On Mac, a drag region has no much different except supporting drag action. App can
// capture most event and window resize(maximum and restore) should be implemented
// by app.
// In short, below two listener, onmousedown and ondbclick is only needed on Mac, Windows
// system has implement similar function. There's a drawback on Windows that maximum
// button info is not sync with system maximum and restore.
document.getElementById("nav-area").onmousedown = () => {
console.log("nav-area mounse down");
// prevent text select for double click action
return false;
};
document.getElementById("nav-area").ondblclick = () => {
console.log("dbclick");
if (
window.innerWidth === screen.width ||
window.innerHeight === screen.height