Skip to content

Commit c577afa

Browse files
cci: fix banner inserted in wrong element
1 parent 548da87 commit c577afa

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/session/DeputyRootSession.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ export default class DeputyRootSession {
108108
window.deputy.session.init();
109109
} );
110110

111-
firstHeading.insertAdjacentElement(
111+
casePage.normalizeSectionHeading(
112+
firstHeading
113+
).insertAdjacentElement(
112114
'beforebegin',
113115
unwrapWidget( messageBox )
114116
);
@@ -134,7 +136,9 @@ export default class DeputyRootSession {
134136
const lastActiveSection =
135137
DeputyRootSession.findFirstLastActiveSection( casePage );
136138
const firstSection =
137-
casePage.findFirstContributionSurveyHeading();
139+
casePage.normalizeSectionHeading(
140+
casePage.findFirstContributionSurveyHeading()
141+
);
138142

139143
// Insert element directly into widget (not as text, or else event
140144
// handlers will be destroyed).
@@ -216,7 +220,8 @@ export default class DeputyRootSession {
216220
return mw.loader.using(
217221
[ 'oojs-ui-core', 'oojs-ui.styles.icons-content' ],
218222
() => {
219-
const firstHeading = casePage.findFirstContributionSurveyHeading();
223+
const firstHeading =
224+
casePage.findFirstContributionSurveyHeading();
220225
if ( firstHeading ) {
221226
const messageBox = DeputyMessageWidget( {
222227
classes: [
@@ -227,7 +232,9 @@ export default class DeputyRootSession {
227232
message: mw.msg( 'deputy.session.tabActive.help' ),
228233
closable: true
229234
} );
230-
firstHeading.insertAdjacentElement(
235+
casePage.normalizeSectionHeading(
236+
firstHeading
237+
).insertAdjacentElement(
231238
'beforebegin',
232239
unwrapWidget( messageBox )
233240
);

0 commit comments

Comments
 (0)