mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-27 17:51:09 +00:00
Merge "Disable section toggling on mobile when replying"
This commit is contained in:
commit
319b5be506
|
@ -193,6 +193,12 @@ CommentController.prototype.setup = function ( mode, hideErrors, suppressNotific
|
||||||
OO.ui.Element.static.scrollIntoView( commentController.newListItem, {
|
OO.ui.Element.static.scrollIntoView( commentController.newListItem, {
|
||||||
padding: scrollPaddingCollapsed
|
padding: scrollPaddingCollapsed
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
// Disable section collapsing on mobile. If the section were collapsed it would be hard to
|
||||||
|
// find your comment again. The "Return to reply" tool is broken by section collapsing as
|
||||||
|
// the reply widget is hidden and therefore not measureable. It's also possible the page is
|
||||||
|
// not long enough to trigger the "Return to reply" tool.
|
||||||
|
$( this.newListItem ).parents( '.collapsible-block' ).prev().addClass( 'collapsible-heading-disabled' );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
@ -217,6 +223,8 @@ CommentController.prototype.setup = function ( mode, hideErrors, suppressNotific
|
||||||
}
|
}
|
||||||
$( commentController.newListItem ).empty().append( replyWidget.$element );
|
$( commentController.newListItem ).empty().append( replyWidget.$element );
|
||||||
|
|
||||||
|
$( this.newListItem ).parents( '.collapsible-block' ).prev().addClass( 'collapsible-heading-disabled' );
|
||||||
|
|
||||||
commentController.setupReplyWidget( replyWidget, {}, suppressNotifications );
|
commentController.setupReplyWidget( replyWidget, {}, suppressNotifications );
|
||||||
|
|
||||||
commentController.showAndFocus();
|
commentController.showAndFocus();
|
||||||
|
@ -373,6 +381,8 @@ CommentController.prototype.showAndFocus = function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
CommentController.prototype.teardown = function ( mode ) {
|
CommentController.prototype.teardown = function ( mode ) {
|
||||||
|
$( this.newListItem ).parents( '.collapsible-block' ).prev().removeClass( 'collapsible-heading-disabled' );
|
||||||
|
|
||||||
if ( mode === 'refresh' ) {
|
if ( mode === 'refresh' ) {
|
||||||
$( this.newListItem ).empty().append(
|
$( this.newListItem ).empty().append(
|
||||||
$( '<span>' ).text( mw.msg( 'discussiontools-replywidget-loading' ) )
|
$( '<span>' ).text( mw.msg( 'discussiontools-replywidget-loading' ) )
|
||||||
|
|
Loading…
Reference in a new issue