- Issue created by @bcizej
- 🇮🇳India ravi kant Jaipur
@bcizej
The theme is not providing option to set delay option but you can do in your custom theme.
- Set "Load library" option as "Local" from your custom theme.
- Create a JS file and add below JS code.
-
/** * @file * Displays any toast messages present on the page. */ (function (Drupal) { 'use strict'; Drupal.behaviors.bootstrap_barrio_toast = { attach: function () { var elements = [].slice.call(document.querySelectorAll('.toast')) var toasts = elements.map(function(toastEl) { return new bootstrap.Toast(toastEl, {delay: 10000}); }); toasts.forEach(toast => toast.show()); } }; })(Drupal);
- Now attach this JS file in global-styling library
- Clear cache , refresh page and check as regeneration steps
- Status changed to Needs review
5 months ago 9:53am 5 June 2024 - Open on Drupal.org →Core: 10.1.0-alpha1 + Environment: PHP 7.4 & MySQL 5.7last update
5 months ago Waiting for branch to pass - 🇸🇮Slovenia bcizej
@ravi kant
Yes, I managed to add settings field and overrided the toasts template to load the proper attribute from config.
I added a PR that fixes the template and adds a new setting field. I don't know if this will be merged but it might be helpful for others on how to modify their subtheme if needed.
- 🇮🇳India ravi kant Jaipur
@bcizej
I checked the branch and found that the option is available now but has no default value. Also, the style is breaking. - 🇸🇮Slovenia bcizej
@ravi kant
There is an update hook that sets the default value via
drush updb
. I don't see any style breaking on my side. - Status changed to Fixed
4 months ago 5:02pm 29 July 2024 Automatically closed - issue fixed for 2 weeks with no activity.