Commit 3d132c2 1 parent aa809ef commit 3d132c2 Copy full SHA for 3d132c2
File tree 2 files changed +14
-19
lines changed
2 files changed +14
-19
lines changed Original file line number Diff line number Diff line change @@ -283,20 +283,21 @@ class QuestionModel extends ComponentModel {
283
283
) || { } ;
284
284
} ;
285
285
286
+ const altTitle = feedback . altTitle || Adapt . course . get ( '_globals' ) . _accessibility . altFeedbackTitle ;
287
+ const title = feedback . title || this . get ( 'title' ) || altTitle || '' ;
288
+
286
289
const feedbackConfig = {
287
- altTitle : feedback . altTitle ||
288
- Adapt . course . get ( '_globals' ) . _accessibility . altFeedbackTitle ||
289
- '' ,
290
- title : feedback . title ||
291
- '' ,
290
+ isAltTitle : ( title === altTitle ) ,
291
+ altTitle,
292
+ title : Handlebars . compile ( title ) ( this . toJSON ( ) ) ,
292
293
_classes : feedback . _classes ,
293
294
...( isLegacyConfig
294
295
? getLegacyConfigObject ( )
295
296
: getConfigObject ( )
296
297
)
297
298
} ;
298
299
299
- if ( feedbackConfig ? ._graphic ?. _src && ! feedbackConfig ? ._imageAlignment ) {
300
+ if ( feedbackConfig . _graphic ?. _src && ! feedbackConfig . _imageAlignment ) {
300
301
feedbackConfig . _imageAlignment = 'right' ;
301
302
}
302
303
@@ -307,8 +308,8 @@ class QuestionModel extends ComponentModel {
307
308
setupFeedback ( ) {
308
309
if ( ! this . has ( '_feedback' ) ) return ;
309
310
const { altTitle = '' , title = '' , body = '' } = this . getFeedback ( ) ;
311
+
310
312
this . set ( {
311
- altFeedbackTitle : Handlebars . compile ( altTitle ) ( this . toJSON ( ) ) ,
312
313
feedbackTitle : Handlebars . compile ( title ) ( this . toJSON ( ) ) ,
313
314
feedbackMessage : Handlebars . compile ( body ) ( this . toJSON ( ) )
314
315
} ) ;
Original file line number Diff line number Diff line change 14
14
{{ /if }}
15
15
16
16
{{ #if title }}
17
- <div class =" notify__title" id =" notify-heading" >
17
+ <div class =" notify__title{{ #if isAltTitle }} aria-label {{ /if }} " id =" notify-heading" >
18
18
<div class =" notify__title-inner" role =" heading" aria-level =" {{ a11y_aria_level _id ' notify' _ariaLevel }} " >
19
19
{{{ compile title }}}
20
20
</div >
21
21
</div >
22
- {{ else if altTitle}}
23
- <div class =" notify__title aria-label" id =" notify-heading" >
24
- <div class =" notify__title-inner" role =" heading" aria-level =" {{ a11y_aria_level _id ' notify' _ariaLevel }} " >
25
- {{{ compile altTitle }}}
26
- </div >
27
- </div >
28
22
{{ /if }}
29
23
30
24
{{ #any _graphic._src body}}
31
25
<div class =" notify__section" >
32
26
<div class =" notify__section-inner" >
33
-
27
+
34
28
{{ #if _graphic._src }}
35
29
{{ #any (equals _imageAlignment ' left' ) (equals _imageAlignment ' top' )}}
36
30
<div class =" notify__image-container{{ #if _graphic.attribution }} has-attribution{{ /if }} " >
45
39
</div >
46
40
{{ ~/any ~}}
47
41
{{ ~/if ~}}
48
-
42
+
49
43
{{ ~#if body ~}}
50
44
<div class =" notify__body" >
51
45
<div class =" notify__body-inner" >
52
46
{{{ compile body }}}
53
47
</div >
54
48
</div >
55
49
{{ ~/if ~}}
56
-
50
+
57
51
{{ ~#if _graphic._src ~}}
58
52
{{ ~#any (equals _imageAlignment ' right' ) (equals _imageAlignment ' bottom' )~}}
59
53
<div class =" notify__image-container{{ #if _graphic.attribution }} has-attribution{{ /if }} " >
68
62
</div >
69
63
{{ /any }}
70
64
{{ /if }}
71
-
65
+
72
66
</div >
73
67
</div >
74
68
{{ /any }}
75
-
69
+
76
70
{{ #equals _type " alert" }}
77
71
<div class =" notify__btn-container" >
78
72
<button class =" btn-text notify__btn notify__btn-alert js-notify-btn-alert" aria-label =" {{{ confirmText }}} " >
You can’t perform that action at this time.
0 commit comments