From 8897113666c9e7e62fed945602910ebcd0ec6421 Mon Sep 17 00:00:00 2001 From: Nicolas Friedli Date: Fri, 17 Jan 2025 19:06:54 +0100 Subject: [PATCH] tpl: Add loading attribute to qr shortcode --- tpl/tplimpl/embedded/templates/shortcodes/qr.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tpl/tplimpl/embedded/templates/shortcodes/qr.html b/tpl/tplimpl/embedded/templates/shortcodes/qr.html index 252ebeae7..818f6656d 100644 --- a/tpl/tplimpl/embedded/templates/shortcodes/qr.html +++ b/tpl/tplimpl/embedded/templates/shortcodes/qr.html @@ -9,6 +9,7 @@ Encodes the given text into a QR code using the specified options and renders th @param {string} [class] The class attribute of the img element. @param {string} [id] The id attribute of the img element. @param {string} [title] The title attribute of the img element. +@param {string} [loading] The loading attribute of the img element, one of lazy, or eager. @returns {template.HTML} @@ -46,6 +47,8 @@ Encodes the given text into a QR code using the specified options and renders th {{- $class := or (.Get "class") "" }} {{- $id := or (.Get "id") "" }} {{- $title := or (.Get "title") "" }} +{{- $loading := or (.Get "loading") "" }} + {{- /* Validate arguments. */}} {{- $errors := false}} @@ -71,6 +74,7 @@ Encodes the given text into a QR code using the specified options and renders th {{- with $class }} class="{{ $class }}" {{- end }} {{- with $id }} id="{{ $id }}" {{- end }} {{- with $title }} title="{{ $title }}" {{- end -}} + {{- with $loading }} loading="{{ $loading }}" {{- end -}} > {{- end }} {{- end -}}