Skip to content

Commit

Permalink
Add lazy loading to question embed iframes #776130
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason.Platts authored and timhunt committed Jul 15, 2024
1 parent 0aa453c commit ac4983f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion templates/embed_iframe.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
}
}}
<iframe
class="filter_embedquestion-iframe" allowfullscreen
class="filter_embedquestion-iframe" allowfullscreen loading="lazy"
title="{{iframedescription}}"
src="{{{showquestionurl}}}"
id="{{embedid}}"{{#name}} name="{{name}}"{{/name}}></iframe>
4 changes: 2 additions & 2 deletions tests/filter_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static function get_cases_for_test_filter(): array {
$cases['defaultoptions'] = [
'{Q{cat/q|' . $requiredtoken . '}Q}',
'<iframe
class="filter_embedquestion-iframe" allowfullscreen
class="filter_embedquestion-iframe" allowfullscreen loading="lazy"
title="' . $title . '"
src="' . $expectedurl . '"
id="cat/q"></iframe>',
Expand Down Expand Up @@ -110,7 +110,7 @@ class="filter_embedquestion-iframe" allowfullscreen
'behaviour=immediatefeedback|marks=10|markdp=3|generalfeedback=0|forcedlanguage=en|' .
$requiredtoken . '}Q}',
'<iframe
class="filter_embedquestion-iframe" allowfullscreen
class="filter_embedquestion-iframe" allowfullscreen loading="lazy"
title="' . $title . '"
src="' . $expectedurl . '"
id="AVquestions/---100"></iframe>',
Expand Down

0 comments on commit ac4983f

Please sign in to comment.