(function() {
/**
* @typedef {Help4.control2.bubble.footer.BubbleFooter.Params} Help4.control2.bubble.footer.Close.Params
*/
/**
* Close footer for bubbles.
* @augments Help4.control2.bubble.footer.BubbleFooter
*/
Help4.control2.bubble.footer.Close = class extends Help4.control2.bubble.footer.BubbleFooter {
/**
* @override
* @param {Help4.control2.bubble.footer.Close.Params} [params]
*/
constructor(params) {
super(params, {
params: {
// all defaults are handled by bubble; do not handle here!
// keep in sync with bubble!
},
statics: {
_close: {}
},
config: {
css: 'control-bubble-footer-close'
}
});
}
/**
* @override
* @param {HTMLElement} dom - control DOM
*/
_onDomCreated(dom) {
super._onDomCreated(dom);
const {
Localization,
control2: {button: {Button, APPEARANCES: {exposed: appearance}}}
} = Help4;
const text = Localization.getText('button.dialogclose');
const title = Localization.getText('button.dialogclose');
this._close = this._createControl(Button, {
id: `${this.id}-close`,
dom,
appearance,
text,
title,
ariaLabel: title
})
.addListener('click', event => {
event.type = 'close';
this._fireEvent(event);
});
}
}
})();