File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -929,16 +929,22 @@ a class:
929
929
<div data-loading="removeClass(opacity-50)">...</div>
930
930
931
931
<!-- add multiple classes when loading -->
932
- <div data-loading="addClass(opacity-50 disabled )">...</div>
932
+ <div data-loading="addClass(opacity-50 text-muted )">...</div>
933
933
934
- Sometimes you may want to add or remove an attribute when loading. That
934
+ Sometimes you may want to add or remove an HTML attribute when loading. That
935
935
can be accomplished with ``addAttribute `` or ``removeAttribute ``:
936
936
937
937
.. code-block :: html+twig
938
938
939
939
<!-- add the "disabled" attribute when loading -->
940
940
<div data-loading="addAttribute(disabled)">...</div>
941
941
942
+ .. caution ::
943
+
944
+ The ``addAttribute() `` and ``removeAttribute() `` functions only work with
945
+ empty HTML attributes (``disabled ``, ``readonly ``, ``required ``, etc.) and
946
+ not with attributes that define their values (e.g. this won't work: ``addAttribute(style='color: red') ``).
947
+
942
948
You can also combine any number of directives by separating them with a
943
949
space:
944
950
You can’t perform that action at this time.
0 commit comments