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
id?:string
_state: number;
handlers : { [type : string]? : [{ type : string, listener : Function }] };
handlers : { [type : string] : [{ type : string, listener : Function }] };
stateChangeCallback: Function;
stateChangeContext: any;
reconnectActionsCallback: Function;

View File

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