Source: control2/bubble/BubbleCover.js

(function() {
    /**
     * @typedef {Help4.control2.Cover.Params} Help4.control2.bubble.BubbleCover.Params
     * @property {Help4.control2.bubble.Bubble} bubble - the corresponding bubble control
     */

    /**
     * provides full-screen background cover for a modal bubble
     * @augments Help4.control2.Cover
     */
    Help4.control2.bubble.BubbleCover = class extends Help4.control2.Cover {
        /**
         * @override
         * @param {Help4.control2.bubble.BubbleCover.Params} [params]
         */
        constructor(params) {
            params ||= {};

            const {bubble} = params;
            if (!bubble) throw new Error('bubble parameter is required!');

            const {TYPES: T} = Help4.jscore.ControlBase;
            super(params, {
                params: {
                    id:      {init: bubble.id + '-cover'},
                    visible: {init: false},

                    bubble:  {type: T.instance, init: bubble, mandatory: true, private: true}
                },
                config: {
                    css: 'control-bubble control-bubble-cover cover'
                }
            });
        }

        /**
         * @override
         * @param {HTMLElement} dom - control DOM
         */
        _onDomAttached(dom) {
            const bubbleDom = this.__bubble.getDom();
            bubbleDom.parentNode.insertBefore(dom, bubbleDom);
        }
    }
})();