| Línea 34... |
Línea 34... |
| 34 |
"subtitle": "Cubing",
|
34 |
"subtitle": "Cubing",
|
| 35 |
"type": "info",
|
35 |
"type": "info",
|
| 36 |
"closebutton": true
|
36 |
"closebutton": true
|
| 37 |
}
|
37 |
}
|
| 38 |
}}
|
38 |
}}
|
| 39 |
<div id="toast-{{uniqid}}" class="toast mx-auto {{#type}}toast-{{type}}{{/type}}" data-delay="{{delay}}" {{^autohide}}data-autohide="false"{{/autohide}}>
|
39 |
<div id="toast-{{uniqid}}" class="toast mx-auto {{#type}}toast-{{type}}{{/type}}" data-bs-delay="{{delay}}" {{^autohide}}data-bs-autohide="false"{{/autohide}}>
|
| 40 |
{{#title}}
|
40 |
{{#title}}
|
| 41 |
<div class="toast-header">
|
41 |
<div class="toast-header">
|
| 42 |
<span class="toast-title">{{{title}}}</span>
|
42 |
<span class="toast-title">{{{title}}}</span>
|
| 43 |
{{#subtitle}}<span class="toast-subtitle ml-auto small">{{{subtitle}}}</span>{{/subtitle}}
|
43 |
{{#subtitle}}<span class="toast-subtitle ms-auto small">{{{subtitle}}}</span>{{/subtitle}}
|
| 44 |
</div>
|
44 |
</div>
|
| 45 |
{{/title}}
|
45 |
{{/title}}
|
| 46 |
<div class="toast-body d-flex">
|
46 |
<div class="toast-body d-flex">
|
| 47 |
<div class="toast-message px-1">{{{message}}}</div>
|
47 |
<div class="toast-message px-1">{{{message}}}</div>
|
| 48 |
{{#closeButton}}
|
48 |
{{#closeButton}}
|
| 49 |
<button type="button" class="ml-auto align-self-baseline close" data-dismiss="toast" aria-label="{{#str}}dismissnotification, core{{/str}}">
|
49 |
<button type="button" class="ms-auto align-self-baseline btn-close" data-bs-dismiss="toast" aria-label="{{#str}}dismissnotification, core{{/str}}"></button>
|
| 50 |
<span aria-hidden="true">×</span>
|
- |
|
| 51 |
</button>
|
- |
|
| 52 |
{{/closeButton}}
|
50 |
{{/closeButton}}
|
| 53 |
</div>
|
51 |
</div>
|
| 54 |
</div>
|
52 |
</div>
|
| 55 |
{{#js}}
|
53 |
{{#js}}
|
| 56 |
require(['jquery', 'theme_boost/bootstrap/toast'], function(jQuery) {
|
54 |
require(['theme_boost/bootstrap/toast'], function(Toast) {
|
| 57 |
// Show the toast.
|
55 |
// Show the toast.
|
| 58 |
// Bootstrap toast components are not shown automatically.
|
56 |
const toastTrigger = document.getElementById('toast-{{uniqid}}');
|
| 59 |
jQuery('#toast-{{uniqid}}').toast('show');
|
57 |
new Toast(toastTrigger).show();
|
| Línea -... |
Línea 58... |
| - |
|
58 |
|
| 60 |
|
59 |
// Remove the toast from the DOM when it is hidden.
|
| 61 |
jQuery('#toast-{{uniqid}}').on('hidden.bs.toast', function(e) {
|
60 |
toastTrigger.addEventListener('hidden.bs.toast', function() {
|
| 62 |
e.target.remove();
|
61 |
toastTrigger.remove();
|
| 63 |
});
|
62 |
});
|
| 64 |
});
|
63 |
});
|