Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing confirmation text only works once #66

Closed
marat-y opened this issue Feb 12, 2018 · 5 comments
Closed

Changing confirmation text only works once #66

marat-y opened this issue Feb 12, 2018 · 5 comments
Assignees
Labels

Comments

@marat-y
Copy link

marat-y commented Feb 12, 2018

Hello!

I'm trying to dynamically change confirmation text. But dialog actually changes only the first time I change data-confirm value. Is there anything else I'm doing wrong or some event I need to trigger for this to work correctly?

I'm using v.1.3.0.

UPD. Updating to 1.6.1 made no effect.

@marat-y marat-y changed the title Changing dialog text only works once Changing confirmation text only works once Feb 12, 2018
@vjt vjt added the question label Mar 10, 2018
@vjt vjt self-assigned this Mar 10, 2018
@vjt
Copy link
Contributor

vjt commented Mar 10, 2018

Hi, sorry for the late reply.

When using data- attributes, the modal is built once by buildModal and then cached into the confirm-modal data attribute by getConfirmModal.

If you want to keep using data- attributes, you can use the newly exposed .getConfirmModal() to get the modal object, and then:

$(..).getConfirmModal().find('.modal-body p').text('new text')

Otherwise, you can use the window.dataConfirmModal() API, that creates new modals every time it is called.

@JamesPlayer
Copy link

Hi, it looks like $(..).getConfirmModal() is not in the latest release (v1.6.2). Could you please release it when you get a chance?

@vjt
Copy link
Contributor

vjt commented Feb 24, 2020

Hi @JamesPlayer,

1.6.3 has been pushed to rubygems. Thanks for the heads up.

@vjt vjt closed this as completed Feb 24, 2020
@jamgregory
Copy link

@vjt - please could you push the latest version to npmjs? It doesn't look like it has been updated there. Thanks! 👍

@Halloran
Copy link

same here...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants