Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 14... Línea 14...
14
In order for this to work you need to use the JavaScript syntax used in core Mustache templates. See the ```{{js}}``` tags in this example below:
14
In order for this to work you need to use the JavaScript syntax used in core Mustache templates. See the ```{{js}}``` tags in this example below:
Línea 15... Línea 15...
15
 
15
 
16
{{< example >}}
16
{{< example >}}
17
<div id="toasttest" role="alert" aria-live="assertive" aria-atomic="true" class="toast" data-autohide="false">
17
<div id="toasttest" role="alert" aria-live="assertive" aria-atomic="true" class="toast" data-autohide="false">
18
  <div class="toast-header">
18
  <div class="toast-header">
19
    <img src="http://placekitten.com/50/50" class="rounded mr-2" alt="PlaceKitten">
19
    <img src="http://placekitten.com/50/50" class="rounded me-2" alt="PlaceKitten">
20
    <strong class="mr-auto">Bootstrap</strong>
20
    <strong class="me-auto">Bootstrap</strong>
21
    <small>11 mins ago</small>
21
    <small>11 mins ago</small>
22
    <button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
22
    <button type="button" class="ms-2 mb-1 btn-close" data-dismiss="toast" aria-label="Close">
23
      <span aria-hidden="true">&times;</span>
23
      <span aria-hidden="true">&times;</span>
24
    </button>
24
    </button>
25
  </div>
25
  </div>
26
  <div class="toast-body">
26
  <div class="toast-body">
27
    Hello, world! This is a toast message.
27
    Hello, world! This is a toast message.
28
  </div>
28
  </div>
29
</div>
29
</div>
30
{{#js}}
30
{{#js}}
31
require(
31
require(
32
[
-
 
33
    'jquery',
32
[
34
    'theme_boost/toast',
33
    'theme_boost/toast',
35
],
34
],
36
function(
-
 
37
    $,
35
function(
38
    Toast
36
    Toast
39
) {
37
) {
40
    var root = $('#toasttest');
38
    const toastTrigger = document.getElementById('toasttest');
41
    root.toast('show');
39
    new Toast(toastTrigger).show();
42
});
40
});
43
{{/js}}
41
{{/js}}
44
{{< /example >}}
42
{{< /example >}}