Untitled

 avatar
unknown
javascript
a year ago
3.3 kB
4
Indexable
/**
 * Pure React component @ portal renderer. most likely a member function
 */
function u(e) {
    
    const { Modal: t } = e, // unpack modal from params
        { name: n, modalProps: a, options: u } = t, // unpack from modal object
        d = (0, o.Wy)().ownerWindow, // get current window? but whats ownerWindow?
        { popup: m, element: p } = (0, l.B)(
            n, // name of the popup 
            {
                title: a.strTitle,
                html_class: "client_chat_frame fullheight ModalDialogPopup LegacyPopup " + (a.className || ""),
                body_class: "fullheight ModalDialogBody",
                popup_class: "fullheight popup_chat_frame",
                owner_window: void 0,
                replace_existing_popup: !0,
                target_browser: a.browserContext,
                availscreenwidth: d.screen.availWidth,
                availscreenheight: d.screen.availHeight,
                bModal: a.bHideMainWindowForPopouts,
            }, // options of the popup
            {
                updateParamsBeforeShow: (e) =>
                    (function (e, t, n, r) {
                        var i, o;
                        let l,
                            s,
                            a,
                            c = t.popupWidth || 500,
                            C = t.popupHeight || 400;
                        if (h.De.IN_CLIENT && (null === (o = null === (i = null == r ? void 0 : r.SteamClient) || void 0 === i ? void 0 : i.Browser) || void 0 === o ? void 0 : o.GetBrowserID)) a = r.SteamClient.Browser.GetBrowserID();
                        else {
                            let e = r.screen;
                            (l = (e.availWidth - c) / 2), (s = (e.availHeight - C) / 2);
                            let t = e;
                            void 0 !== t.availLeft && void 0 !== t.availTop && ((l += t.availLeft), (s += t.availTop));
                        }
                        return Object.assign(Object.assign({}, e), { dimensions: { width: c, height: C, left: l, top: s }, center_on_window: n.bCenterOnWindow ? r : void 0, window_opener_id: a });
                    })(e, a, u, d),
                onClose: () => a.fnOnClose && a.fnOnClose(),
            } // overrides, not important
        ),
        g = null == u ? void 0 : u.bHideActions,
        f = "number" == typeof (null == u ? void 0 : u.nDragAreaHeight) ? { height: u.nDragAreaHeight } : void 0;
    return p
        ? i.createPortal(
              r.createElement(
                  o.Rt, // create host component with ownerWindow, but o.Rt is unknown
                  { ownerWindow: m },
                  r.createElement(
                      "div",
                      { className: "PopupFullWindow", onContextMenu: s.T }, // s.T is uknown, handles context menus, but isn't vital
                      r.createElement(C.T, { hideMin: !0, hideMax: !0, popup: m, hideActions: g, style: f }), // create titlebar controls.
                      r.createElement(c.Y0, { browserInfo: a.browserContext, bCenterPopupsOnWindow: u.bCenterOnWindow }, t.element) // not entirely sure
                  )
              ),
              p
          )
        : null;
}
Editor is loading...
Leave a Comment