(function() {
/**
* @typedef {Help4.control2.Control.Params} Help4.control2.bubble.content.BubbleContent.Params
* @property {Help4.control2.bubble.Bubble} bubble - the corresponding bubble control
* @property {boolean} [textOnly = true] - flag for text only content
*/
/**
* Base class for bubble content
* @augments Help4.control2.Control
*/
Help4.control2.bubble.content.BubbleContent = class extends Help4.control2.Control {
/**
* @override
* @param {Help4.control2.bubble.content.BubbleContent.Params} [params]
* @param {Help4.jscore.ControlBase.Params} [derived]
*/
constructor(params, derived) {
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}-content`},
tabIndex: {init: 0},
autoEvent: {init: true}, // to monitor mouseout & mouseover events; XRAY-2615, XRAY-4628
bubble: {type: T.instance, init: bubble, mandatory: true, private: true},
textOnly: {type: T.boolean, init: true, readonly: true}
},
config: {
css: 'control-bubble-content content dgo_text_container'
},
derived
});
}
/**
* @override
* @param {HTMLElement} dom - control DOM
*/
_onDomAvailable(dom) {
super._onDomAvailable(dom);
if (!this.textOnly) this.removeCss('dgo_text_container');
}
}
})();