A
A
Alexander2021-05-14 12:28:46
1C-Bitrix
Alexander, 2021-05-14 12:28:46

How to add a button to the Bitrix model window?

There is a standard Bitrix modal window, I want to insert an additional one into it. a button that closes this window and brings up another, bootstrap one.
I found the code in the script, added the "1 click" button

if (this.config.showClosePopup)
          {
            popupButtons = [
              new BasketButton({
                text: BX.message('BTN_MESSAGE_BASKET_REDIRECT'),
                events: {
                  click: BX.delegate(this.basketRedirect, this)
                },
                style: {marginRight: '10px'}
              }),
              new BasketButton({
                text: BX.message('BTN_MESSAGE_CLOSE_POPUP'),
                events: {
                  click: BX.delegate(this.obPopupWin.close, this.obPopupWin)
                }
              }),
                            new BasketButton({
                                text: '1 клик',
                                events: {
                                    click: BX.delegate(this.obPopupWin.close, $('#oneclick').modal('show'))
                                }
                            })
            ];
          }


but what is it
click: BX.delegate(this.obPopupWin.close, $('#oneclick').modal('show'))

that the modal opens even when you click buy, i.e. Two windows open at once, instead of one and then another. Maybe I'm doing something wrong or in the wrong place? click: $('#oneclick').modal('show')

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
PetrPo, 2021-05-16
@kikher

The most obvious option

click:  function() {
    $('#oneclick').modal('show')
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question