mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-28 01:20:07 +00:00
91e2e55a10
- Remove the 'vector-scrolled-below-table-of-contents' class, reducing the number of classes added with JS and simplifying the scrollObserver logic - Move the 'vector-sticky-header-visible' class from the sticky header element to the body element. Hopefully, this is where other feature specific classes can go in the future - This approach means the TOC will not need JS to update it's spacing when the sticky header is not enabled Bug: T307345 Change-Id: I1084defc7025f5c946e22a36d373224fae6f8bd6
51 lines
1.2 KiB
JavaScript
51 lines
1.2 KiB
JavaScript
import template from '!!raw-loader!../includes/templates/StickyHeader.mustache';
|
|
import Button from '!!raw-loader!../includes/templates/Button.mustache';
|
|
import { searchBoxData } from './SearchBox.stories.data';
|
|
|
|
const NO_ICON = {
|
|
icon: 'none',
|
|
'is-quiet': true,
|
|
class: 'sticky-header-icon'
|
|
};
|
|
|
|
const TALK_ICON = {
|
|
icon: 'none',
|
|
'is-quiet': true,
|
|
class: 'sticky-header-icon mw-ui-icon-wikimedia-speechBubbles'
|
|
};
|
|
|
|
const HISTORY_ICON = {
|
|
icon: 'none',
|
|
'is-quiet': true,
|
|
class: 'sticky-header-icon mw-ui-icon-wikimedia-history'
|
|
};
|
|
|
|
const data = {
|
|
title: 'Audre Lorde',
|
|
heading: 'Introduction',
|
|
'data-primary-action': {
|
|
id: 'p-lang-btn-sticky-header',
|
|
class: 'mw-interlanguage-selector',
|
|
'is-quiet': true,
|
|
label: '196 languages',
|
|
'html-vector-button-icon': `<span class="mw-ui-icon mw-ui-icon-wikimedia-language"></span>`
|
|
},
|
|
'data-search': searchBoxData,
|
|
'data-button-start': {
|
|
icon: 'wikimedia-search',
|
|
class: 'vector-sticky-header-search-toggle',
|
|
'is-quiet': true,
|
|
label: 'Search'
|
|
},
|
|
'data-button-end': NO_ICON,
|
|
'data-buttons': [
|
|
TALK_ICON, HISTORY_ICON, NO_ICON, NO_ICON
|
|
]
|
|
};
|
|
|
|
export const STICKY_HEADER_TEMPLATE_PARTIALS = {
|
|
Button
|
|
};
|
|
|
|
export { template, data };
|