Skip to content

pantoken-root / formats/interactions/src / initCloseButton

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

initCloseButton(btn): void

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

Թիրախի որոշում (առաջին համապատասխանողը հաղթում է):

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

Փակման ռազմավարություն:

  • <dialog> → dialog.close()
  • [popover] → el.hidePopover()
  • [data-dismissible] կամ [open] → ջնջել open հատկանիշը + արձակել բխող close

Պարամետրեր ​

btn ​

HTMLElement

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

void