Swap Promise for jQuery.Promise in loadingFinished() & doLoadingFinished()

This lets us add LitElement's updateComplete Promise into the list of things to wait for, and solves the problem of app init code being run before widgets are complete.

https://lit.dev/docs/components/lifecycle/#reactive-update-cycle-completing
This commit is contained in:
nathan
2022-03-08 15:11:32 -07:00
parent 1b74f1f1a7
commit f7f4053d1a
9 changed files with 145 additions and 120 deletions

View File

@@ -18,14 +18,8 @@ import {ClassWithAttributes} from './et2_core_inheritance';
import {et2_IDOMNode} from "./et2_core_interfaces";
import {et2_hasChild, et2_no_init} from "./et2_core_common";
import {et2_widget, WidgetConfig} from "./et2_core_widget";
import {
egw_getActionManager,
egwActionObject,
egwActionObjectInterface,
egw_getAppObjectManager,
egw_getObjectManager
} from '../egw_action/egw_action.js';
import {EGW_AI_DRAG_OVER, EGW_AI_DRAG_OUT} from '../egw_action/egw_action_constants.js';
import {egw_getActionManager, egw_getAppObjectManager, egw_getObjectManager} from '../egw_action/egw_action.js';
import {EGW_AI_DRAG_OUT, EGW_AI_DRAG_OVER} from '../egw_action/egw_action_constants.js';
import {egw} from "../jsapi/egw_global";
// fixing circular dependencies by only importing type
import type {et2_tabbox} from "./et2_widget_tabs";
@@ -170,7 +164,7 @@ export abstract class et2_DOMWidget extends et2_widget implements et2_IDOMNode
/**
* Attaches the container node of this widget to the DOM-Tree
*/
doLoadingFinished() : boolean | JQueryPromise<unknown>
doLoadingFinished() : boolean | Promise<any>
{
// Check whether the parent implements the et2_IDOMNode interface. If
// yes, grab the DOM node and create our own.