mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-05-01 22:01:49 +01:00
Rename files
This commit is contained in:
20
ts/util/isWindowDragElement.std.ts
Normal file
20
ts/util/isWindowDragElement.std.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
export function isWindowDragElement(el: Readonly<Element>): boolean {
|
||||
let currentEl: Element | null = el;
|
||||
do {
|
||||
const appRegion =
|
||||
getComputedStyle(currentEl).getPropertyValue('-webkit-app-region');
|
||||
switch (appRegion) {
|
||||
case 'no-drag':
|
||||
return false;
|
||||
case 'drag':
|
||||
return true;
|
||||
default:
|
||||
currentEl = currentEl.parentElement;
|
||||
break;
|
||||
}
|
||||
} while (currentEl);
|
||||
return false;
|
||||
}
|
||||
Reference in New Issue
Block a user