MCPcopy Create free account
hub / github.com/UI5/webcomponents / constructor

Method constructor

packages/main/src/Button.ts:425–451  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

423 @i18n("@ui5/webcomponents")
424 static i18nBundle: I18nBundle;
425 constructor() {
426 super();
427 this._deactivate = () => {
428 if (activeButton) {
429 activeButton._setActiveState(false);
430 }
431 };
432
433 this._onclickBound = e => {
434 if (e instanceof CustomEvent) {
435 return;
436 }
437
438 this._onclick(e);
439 };
440
441 if (!this._clickHandlerAttached) {
442 this.addEventListener("click", this._onclickBound);
443 this._clickHandlerAttached = true;
444 }
445
446 if (!isGlobalHandlerAttached) {
447 document.addEventListener("mouseup", this._deactivate);
448
449 isGlobalHandlerAttached = true;
450 }
451 }
452
453 _ontouchstart() {
454 if (this.nonInteractive) {

Callers

nothing calls this directly

Calls 2

_onclickMethod · 0.95
_setActiveStateMethod · 0.80

Tested by

no test coverage detected