T
T
tgarl2021-07-02 16:44:59
1C-Bitrix
tgarl, 2021-07-02 16:44:59

How to bypass the ban on clicks in BX.PopupWindow?

Good afternoon.
decided to use BX.PopupWindow to display pop-up windows.
content is loaded into it by calling
oPopup.setContent(BX('hideBlock'));
hideBlock itself - via ajax.

but when a form with fields that need to be processed on click is loaded in a popup, I come across that a click ban is hung on this pump

key: "handleContainerClick",
      value: function handleContainerClick(event) {
        event.stopPropagation();
      }


How can I bypass this ban to make it work
$(document).on('click', '#formseeobject1 a.form__btn1', function(){ alert();})

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
PetrPo, 2021-07-02
@tgarl

You need to add the parameter compatibleMode: false

T
tgarl, 2021-07-02
@tgarl

There are 2 solutions to this problem:
1. as PetrPo wrote, add a parameter
compatibleMode: false
2. I found this

events: {
    onAfterPopupShow: function(popup) {
          var obj= BX.findChild(popup.contentContainer, {className: 'form__btn1'}, true);
          if (obj)
          {
            BX.bind(obj, 'mousedown', function(){ 
              alert('111');
            });
          }
    }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question