Move "Return to comment" below sticky header when present

Also ensure that when we click the button, we scroll the widget fully
into view below the sticky header.

Bug: T318474
Change-Id: I394f02912cd6ab2773552a7364691ef89a17369c
This commit is contained in:
Ed Sanders 2022-09-24 12:37:39 +01:00
parent fb7a25ce91
commit 688cdc24ae
3 changed files with 11 additions and 2 deletions

View file

@ -4,7 +4,7 @@
"stylelint-config-wikimedia/mediawiki"
],
"rules": {
"selector-class-pattern": "^(ext|ve|mw|oo-ui|client|skin|mf)-",
"selector-class-pattern": "^(ext|ve|mw|oo-ui|client|skin|mf|vector)-",
"unit-disallowed-list": null
}
}

View file

@ -4,7 +4,11 @@ var
logger = require( './logger.js' ),
dtConf = require( './config.json' ),
CommentItem = require( './CommentItem.js' ),
scrollPadding = { top: 10, bottom: 10 },
scrollPadding = {
// eslint-disable-next-line no-jquery/no-class-state
top: 10 + ( $( document.body ).hasClass( 'vector-feature-sticky-header-enabled' ) ? 50 : 0 ),
bottom: 10
},
defaultEditMode = mw.user.options.get( 'discussiontools-editmode' ) || mw.config.get( 'wgDiscussionToolsFallbackEditMode' ),
defaultVisual = defaultEditMode === 'visual',
featuresEnabled = mw.config.get( 'wgDiscussionToolsFeaturesEnabled' ) || {},

View file

@ -52,6 +52,10 @@
transform: translate( -50%, -150% );
top: 0;
left: 50%;
.vector-sticky-header-visible & {
top: 50px;
}
}
&-scrollback-bottom {
@ -60,6 +64,7 @@
left: 50%;
}
// stylelint-disable-next-line no-descending-specificity
&-scrollback-top,
&-scrollback-bottom {
position: fixed;