Fix collapsed sections when recovering autosave on mobile, take 2

Follow-up to 8a8c7270cf.

I think this wasn't working becase we were doing it in the wrong
order (reply tool initialization would disable toggling section
state before toggler toggled it open).

Bug: T338920
Change-Id: I7ed3d5c149ddb3d33cb67010f032c63e175687f2
This commit is contained in:
Bartosz Dziewoński 2024-02-04 00:21:45 +01:00
parent 9f650c92ee
commit 3957d7ac25

View file

@ -489,12 +489,12 @@ function init( $container, state ) {
if ( storage.get( 'saveable' ) ) {
mode = storage.get( 'mode' );
$link = $( commentNodes[ i ] );
setupController( comment, $link, mode, true, !state.firstLoad, storage );
if ( OO.ui.isMobile() ) {
var urlFragment = mw.util.escapeIdForLink( comment.id );
// Force the section to expand on mobile (T338920)
location.hash = '#' + urlFragment;
}
setupController( comment, $link, mode, true, !state.firstLoad, storage );
break;
}
}