mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-12-02 03:07:13 +00:00
0eb8811e7a
* Introduce a generalized feature toggle system that uses user preferences or localStorage for anons (right now the latter is out of scope but will be explored in a follow up) * Feature flagged to VisualEnhancementNext for now, given the dependency on icon size Bug: T319449 Change-Id: I7343a3f38b720411d5ef5f3414f25f475b0bb84a
16 lines
406 B
JavaScript
16 lines
406 B
JavaScript
var features = require( './features.js' );
|
|
|
|
/**
|
|
* adds a toggle button
|
|
*/
|
|
function init() {
|
|
var toggle = document.createElement( 'div' );
|
|
toggle.classList.add( 'mw-ui-icon', 'mw-ui-icon-element', 'mw-ui-button', 'vector-limited-width-toggle' );
|
|
document.body.appendChild( toggle );
|
|
toggle.addEventListener( 'click', function () {
|
|
features.toggle( 'limited-width' );
|
|
} );
|
|
}
|
|
|
|
module.exports = init;
|