forked from bitfoundation/bitplatform
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgeneral.ts
More file actions
32 lines (25 loc) · 1.16 KB
/
general.ts
File metadata and controls
32 lines (25 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
(BitBlazorUI as any).version = (window as any)['bit-blazorui version'] = '10.4.3-pre-01';
interface DotNetObject {
invokeMethod<T>(methodIdentifier: string, ...args: any[]): T;
invokeMethodAsync<T>(methodIdentifier: string, ...args: any[]): Promise<T>;
dispose(): void;
}
window.addEventListener('scroll', (e: Event) => {
const currentCallout = BitBlazorUI.Callouts.current;
if (window.innerWidth < BitBlazorUI.Utils.MAX_MOBILE_WIDTH && currentCallout.responsiveMode) return;
const target = e.target as HTMLElement;
if (target?.id && target.id == currentCallout.scrollContainerId) return;
BitBlazorUI.Callouts.replaceCurrent();
}, true);
window.addEventListener('resize', (e: any) => {
const resizeTriggeredByOpenningKeyboard = document?.activeElement?.getAttribute('type') === 'text';
if (window.innerWidth < BitBlazorUI.Utils.MAX_MOBILE_WIDTH && resizeTriggeredByOpenningKeyboard) return;
BitBlazorUI.Callouts.replaceCurrent();
}, true);
namespace BitBlazorUI {
export class BitController {
id: string = Utils.uuidv4();
controller = new AbortController();
dotnetObj: DotNetObject | undefined;
}
}