The twig computed element is just fantastic and the ability to ajax-load it is even more fantastic.

I was able to build an order webform with inline price calculations via AJAX: terrific!

But, since calculating all the prices takes about a second, it would be real cool to have a class on the element that is reloading, or perhaps on the entire form. That way we can do some theming, adding a loader icon for example.

Would that be possible?

CommentFileSizeAuthor
#2 3011502-2.patch1.89 KBjrockowitz

Comments

weseze created an issue. See original summary.

jrockowitz’s picture

Status: Active » Needs review
StatusFileSize
new1.89 KB

Attached patch highlights the computed value in yellow and even includes some code to prevent duplicate calculations.

  • jrockowitz committed 61f9a3a on 8.x-5.x
    Issue #3011502 by jrockowitz: Add a "loading"-class to computed elements...
jrockowitz’s picture

Status: Needs review » Fixed

I committed the patch. Please download the latest dev release to review.

weseze’s picture

Works perfectly, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.