Skip to content

pantoken-root / formats/interactions/src / initCloseButton

Ֆունկցիա: initCloseButton() ​

initCloseButton(btn): void

Կապեք փակման կոճակը՝ դրա թիրախը փակելու համար։

Target resolution (առաջին համապատասխանությունն է վճիռը):

  1. data-close-target="id" — հեռացնել այդ id-ով տարրը
  2. popovertarget / commandfor — անտեսել; նատիվ բրաուզերը դա կառավարում է
  3. քայլել մինչև ամենամոտ <dialog>, [popover], [data-dismissible], [open], ահազանգ (alert) կամ տողատախտակ (banner)

Dismiss strategy:

  • <dialog> → dialog.close()
  • [popover] → el.hidePopover()
  • .instui-alert կամ .instui-banner → հնարավոր է չեղարկել dismiss իրադարձությունը, ապա աստիճանաբար թափանցիկ դարձնել և դուրս հանել
  • [data-dismissible] կամ [open] → հեռացնել open հատկանիշը + արձակել բխող close

Պարամետրեր ​

btn ​

HTMLElement

Վերադարձվող արժեք ​

void