mediawiki-skins-Vector/resources/skins.vector.js/limitedWidthToggle.js

16 lines
406 B
JavaScript
Raw Normal View History

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;