File tree Expand file tree Collapse file tree 8 files changed +88
-16
lines changed Expand file tree Collapse file tree 8 files changed +88
-16
lines changed Original file line number Diff line number Diff line change 1
1
// Apply to course.json, contentObject.json, blocks.json or components.json
2
-
2
+
3
3
"_scrollPrompt" : {
4
4
"_isEnabled" : true ,
5
- "instruction" : " {{_globals._extensions._scrollPrompt.scrollDown}}"
5
+ "instruction" : " {{_globals._extensions._scrollPrompt.scrollDown}}" ,
6
+ "_iconClass" : " icon-controls-down"
6
7
}
Original file line number Diff line number Diff line change 6
6
align-items : center ;
7
7
}
8
8
9
- &__btn .icon {
10
- .icon-controls-down ;
11
- }
12
-
13
9
&__instruction {
14
- margin-left : 1rem ;
15
- .dir-rtl & {
16
- margin-left : inherit ;
17
- margin-right : 1rem ;
18
- }
10
+ margin-inline-start : 1rem ;
19
11
}
20
12
}
Original file line number Diff line number Diff line change 35
35
"inputType": "Text",
36
36
"validators": [],
37
37
"translatable": true
38
+ },
39
+ "_iconClass": {
40
+ "type": "string",
41
+ "required": false,
42
+ "default": "icon-controls-down",
43
+ "title": "Button icon class",
44
+ "inputType": "Text",
45
+ "validators": [],
46
+ "help": "CSS class name to be applied to the scroll prompt button icon."
38
47
}
39
48
}
40
49
}
60
69
"inputType": "Text",
61
70
"validators": [],
62
71
"translatable": true
72
+ },
73
+ "_iconClass": {
74
+ "type": "string",
75
+ "required": false,
76
+ "default": "icon-controls-down",
77
+ "title": "Button icon class",
78
+ "inputType": "Text",
79
+ "validators": [],
80
+ "help": "CSS class name to be applied to the scroll prompt button icon."
63
81
}
64
82
}
65
83
}
85
103
"inputType": "Text",
86
104
"validators": [],
87
105
"translatable": true
106
+ },
107
+ "_iconClass": {
108
+ "type": "string",
109
+ "required": false,
110
+ "default": "icon-controls-down",
111
+ "title": "Button icon class",
112
+ "inputType": "Text",
113
+ "validators": [],
114
+ "help": "CSS class name to be applied to the scroll prompt button icon."
88
115
}
89
116
}
90
117
}
110
137
"inputType": "Text",
111
138
"validators": [],
112
139
"translatable": true
140
+ },
141
+ "_iconClass": {
142
+ "type": "string",
143
+ "required": false,
144
+ "default": "icon-controls-down",
145
+ "title": "Button icon class",
146
+ "inputType": "Text",
147
+ "validators": [],
148
+ "help": "CSS class name to be applied to the scroll prompt button icon."
113
149
}
114
150
}
115
151
}
Original file line number Diff line number Diff line change 24
24
"type" : " string" ,
25
25
"title" : " Instruction text" ,
26
26
"default" : " {{_globals._extensions._scrollPrompt.scrollDown}}"
27
+ },
28
+ "_iconClass" : {
29
+ "type" : " string" ,
30
+ "title" : " Button icon class" ,
31
+ "description" : " CSS class name to be applied to the scroll prompt button icon." ,
32
+ "default" : " icon-controls-down"
27
33
}
28
34
}
29
35
}
Original file line number Diff line number Diff line change 24
24
"type" : " string" ,
25
25
"title" : " Instruction text" ,
26
26
"default" : " {{_globals._extensions._scrollPrompt.scrollDown}}"
27
+ },
28
+ "_iconClass" : {
29
+ "type" : " string" ,
30
+ "title" : " Button icon class" ,
31
+ "description" : " CSS class name to be applied to the scroll prompt button icon." ,
32
+ "default" : " icon-controls-down"
27
33
}
28
34
}
29
35
}
Original file line number Diff line number Diff line change 24
24
"type" : " string" ,
25
25
"title" : " Instruction text" ,
26
26
"default" : " {{_globals._extensions._scrollPrompt.scrollDown}}"
27
+ },
28
+ "_iconClass" : {
29
+ "type" : " string" ,
30
+ "title" : " Button icon class" ,
31
+ "description" : " CSS class name to be applied to the scroll prompt button icon." ,
32
+ "default" : " icon-controls-down"
27
33
}
28
34
}
29
35
}
Original file line number Diff line number Diff line change 51
51
"type" : " string" ,
52
52
"title" : " Instruction text" ,
53
53
"default" : " {{_globals._extensions._scrollPrompt.scrollDown}}"
54
+ },
55
+ "_iconClass" : {
56
+ "type" : " string" ,
57
+ "title" : " Button icon class" ,
58
+ "description" : " CSS class name to be applied to the scroll prompt button icon." ,
59
+ "default" : " icon-controls-down"
54
60
}
55
61
}
56
62
}
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
- import { compile } from 'core/js/reactHelpers' ;
2
+ import { classes , compile } from 'core/js/reactHelpers' ;
3
3
4
4
export default function ScrollPrompt ( props ) {
5
5
const {
@@ -8,14 +8,33 @@ export default function ScrollPrompt (props) {
8
8
} = props ;
9
9
10
10
return (
11
- < div className = "scrollPrompt__inner a11y-ignore" aria-hidden = "true" >
12
- < button className = "btn-icon scrollPrompt__btn" onClick = { onScrollPromptClick } >
13
- < span className = "icon" />
11
+ < div
12
+ className = 'scrollPrompt__inner a11y-ignore'
13
+ aria-hidden = 'true'
14
+ >
15
+
16
+ < button
17
+ className = 'btn-icon scrollPrompt__btn'
18
+ onClick = { onScrollPromptClick }
19
+ >
20
+ < span
21
+ className = { classes ( [
22
+ 'icon' ,
23
+ _scrollPrompt . _iconClass
24
+ ? _scrollPrompt . _iconClass
25
+ : 'icon-controls-down'
26
+ ] ) }
27
+ aria-hidden = 'true'
28
+ />
14
29
</ button >
15
30
16
31
{ _scrollPrompt . instruction &&
17
- < div className = "scrollPrompt__instruction" dangerouslySetInnerHTML = { { __html : compile ( _scrollPrompt . instruction , props ) } } />
32
+ < div
33
+ className = 'scrollPrompt__instruction'
34
+ dangerouslySetInnerHTML = { { __html : compile ( _scrollPrompt . instruction , props ) } }
35
+ />
18
36
}
37
+
19
38
</ div >
20
39
) ;
21
40
}
You can’t perform that action at this time.
0 commit comments