@@ -92,14 +92,14 @@ export class U {
92
92
* @returns {HTMLElement }
93
93
*/
94
94
static modalHint ( config ) {
95
+ const hint = document . createElement ( "span" ) ;
96
+
95
97
if ( ! config . modal ) {
96
- return null ;
98
+ return hint ;
97
99
}
98
100
99
- const hint = document . createElement ( "span" ) ;
100
101
hint . innerText = "?" ;
101
102
hint . classList . add ( "modal-hint" ) ;
102
- hint . dataset [ "modal" ] = config . modal ;
103
103
104
104
hint . addEventListener ( 'click' , ( e ) => {
105
105
const modal = e . target . nextElementSibling ;
@@ -108,7 +108,7 @@ export class U {
108
108
} ) ;
109
109
110
110
return hint ;
111
- }
111
+ }
112
112
113
113
/**
114
114
* Creates modal element with event handlers
@@ -117,11 +117,12 @@ export class U {
117
117
* @returns {null|HTMLDivElement }
118
118
*/
119
119
static modal ( config ) {
120
+ const modal = document . createElement ( "div" ) ;
121
+
120
122
if ( ! config . modal ) {
121
- return null ;
123
+ return modal ;
122
124
}
123
125
124
- const modal = document . createElement ( "div" ) ;
125
126
modal . classList . add ( "modal" ) ;
126
127
127
128
const backdrop = document . createElement ( "div" ) ;
@@ -206,7 +207,10 @@ export class U {
206
207
207
208
const rowWrapper = document . createElement ( 'tr' ) ;
208
209
const labelTh = document . createElement ( 'th' ) ;
209
- labelTh . innerText = fieldConfig . label + this . requiredMark ( fieldConfig ) ;
210
+ labelTh . insertAdjacentText ( "afterbegin" , fieldConfig . label + this . requiredMark ( fieldConfig ) ) ;
211
+ labelTh . insertAdjacentHTML ( "beforeend" , U . tooltipHint ( fieldConfig ) ) ;
212
+ labelTh . appendChild ( U . modalHint ( fieldConfig ) ) ;
213
+ labelTh . appendChild ( U . modal ( fieldConfig ) ) ;
210
214
rowWrapper . appendChild ( labelTh ) ;
211
215
212
216
for ( let i = 0 ; i < repeat ; i ++ ) {
0 commit comments