title | issue |
---|---|
Fix console error on AjaxModal |
NEXT-24448 |
- Deprecated selector
[data-bs-toggle="modal"][data-url]
to initialize theAjaxModal
plugin. Use selector[data-ajax-modal][data-url]
instead. - Deprecated translation key
general.privacyNotice
. Usegeneral.privacyNoticeText
instead. - Deprecated translation key
account.profileDelete
. Useaccount.profileDeleteText
instead. - Deprecated translation key
checkout.confirmTerms
. Usecheckout.confirmTermsText
instead. - Deprecated translation key
checkout.confirmTermsReminder
. Usecheckout.confirmTermsReminderText
instead. - Deprecated translation key
contact.privacyNotice
. Usecontact.privacyNoticeText
instead. - Deprecated translation key
footer.serviceContactLink
. Usefooter.serviceContactText
instead. - Deprecated translation key
footer.includeVat
. Usefooter.includeVatText
instead. - Deprecated translation key
footer.excludeVat
. Usefooter.excludeVatText
instead. - Deprecated translation key
cookie.message
. Usecookie.messageText
instead. - Deprecated translation key
component.cms.vimeo.privacyNotice
. Usecomponent.cms.vimeo.privacyNoticeText
instead.
The JavaScript plugin AjaxModal
is able to open a Bootstrap modal and fetching content via ajax.
This is currently done by using the known Bootstrap selector for opening modals [data-bs-toggle="modal"]
and an additional [data-url]
.
The corresponding modal HTML isn't existing upfront and will be created by AjaxModal
internally by using the .js-pseudo-modal-template
template.
However, Bootstrap v5 needs a data-bs-target="*"
upfront which points to the desired HTML of a modal. Otherwise, it throws a JavaScript error because the Modal's DOM cannot be found.
The AjaxModal
itself works regardless of the error.
Because we don't want to enforce to have an additional data-bs-target="*"
selector everywhere and want to keep the general workflow using AjaxModal
, we change the
selector, which is initializing the AjaxModal
plugin, to [data-ajax-modal][data-url]
to not interfere with the Bootstrap default modal.
AjaxModal
will do all modal related tasks programmatically and does not rely on Bootstraps data-attribute API.
<a data-bs-toggle="modal" data-url="/my/route" href="/my/route">Open Ajax Modal</a>
<a data-ajax-modal="true" data-url="/my/route" href="/my/route">Open Ajax Modal</a>
The selector to initialize the AjaxModal
plugin will be changed to not interfere with Bootstrap defaults data-attribute API.
<a data-bs-toggle="modal" data-url="/my/route" href="/my/route">Open Ajax Modal</a>
<a data-ajax-modal="true" data-url="/my/route" href="/my/route">Open Ajax Modal</a>