Skip to content

Commit ac4983f

Browse files
Jason.Plattstimhunt
Jason.Platts
authored andcommitted
Add lazy loading to question embed iframes #776130
1 parent 0aa453c commit ac4983f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

templates/embed_iframe.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
}
3737
}}
3838
<iframe
39-
class="filter_embedquestion-iframe" allowfullscreen
39+
class="filter_embedquestion-iframe" allowfullscreen loading="lazy"
4040
title="{{iframedescription}}"
4141
src="{{{showquestionurl}}}"
4242
id="{{embedid}}"{{#name}} name="{{name}}"{{/name}}></iframe>

tests/filter_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public static function get_cases_for_test_filter(): array {
7979
$cases['defaultoptions'] = [
8080
'{Q{cat/q|' . $requiredtoken . '}Q}',
8181
'<iframe
82-
class="filter_embedquestion-iframe" allowfullscreen
82+
class="filter_embedquestion-iframe" allowfullscreen loading="lazy"
8383
title="' . $title . '"
8484
src="' . $expectedurl . '"
8585
id="cat/q"></iframe>',
@@ -110,7 +110,7 @@ class="filter_embedquestion-iframe" allowfullscreen
110110
'behaviour=immediatefeedback|marks=10|markdp=3|generalfeedback=0|forcedlanguage=en|' .
111111
$requiredtoken . '}Q}',
112112
'<iframe
113-
class="filter_embedquestion-iframe" allowfullscreen
113+
class="filter_embedquestion-iframe" allowfullscreen loading="lazy"
114114
title="' . $title . '"
115115
src="' . $expectedurl . '"
116116
id="AVquestions/---100"></iframe>',

0 commit comments

Comments
 (0)