Fix access before initialization issue breaking JS tests

This commit is contained in:
nathan 2024-11-15 10:09:43 -07:00
parent 73a606f6ba
commit 2dc9c4ec57
2 changed files with 17 additions and 12 deletions

View File

@ -23,7 +23,7 @@ export interface EgwActionObjectInterface {
//properties //properties
id?:string id?:string
_state: number; _state: number;
handlers : { [type : string]? : [{ type : string, listener : Function }] }; handlers : { [type : string] : [{ type : string, listener : Function }] };
stateChangeCallback: Function; stateChangeCallback: Function;
stateChangeContext: any; stateChangeContext: any;
reconnectActionsCallback: Function; reconnectActionsCallback: Function;

View File

@ -388,21 +388,26 @@ export class egwDragAction extends EgwDragAction {
}; };
})() })()
let _dragActionImpl = null;
export function getDragImplementation() { export function getDragImplementation() {
if (!_dragActionImpl) { if(typeof window["_egwActionImpls"] != "object")
_dragActionImpl = new EgwDragActionImplementation(); {
window["_egwActionImpls"] = {};
}
if(!window["_egwActionImpls"]._dragActionImpl)
{
window["_egwActionImpls"]._dragActionImpl = new EgwDragActionImplementation();
} }
return _dragActionImpl; return window["_egwActionImpls"]._dragActionImpl;
} }
let _dropActionImpl = null;
export function getDropImplementation() { export function getDropImplementation() {
if (!_dropActionImpl) { if(typeof window["_egwActionImpls"] != "object")
_dropActionImpl = new egwDropActionImplementation(); {
window["_egwActionImpls"] = {};
}
if(!window["_egwActionImpls"]._dropActionImpl)
{
window["_egwActionImpls"]._dropActionImpl = new egwDropActionImplementation();
} }
return _dropActionImpl; return window["_egwActionImpls"]._dropActionImpl;
} }