MediaWiki:Gadget-stickyScrollBackground.js

// ________________________________________________________________________________________ // |                                                                                        | // |                    === WARNING: GLOBAL GADGET FILE ===                                 | // |                 Changes to this page affect many users. | // |																						| // |________________________________________________________________________________________| // // Rolling Release 04.07.2021 "use strict";

var parentElement = document.getElementById("mw-content-container"); var container = document.createElement("div"); container.id = "sticky-container"; var slider = document.createElement("div"); slider.id = "sticky-slider"; var left = document.createElement("div"); left.id = "sticky-left"; var right = document.createElement("div"); right.id = "sticky-right";

parentElement.prepend(container); container.append(slider); slider.append(left); slider.append(right);

// Gadget-enableTopNavBar compatibility fix if (mw.user.options.get('gadget-stickyScrollBackground',"") === "1") { var stickyScrollBackgroundFix = ["@media screen and (max-width: 1339px) {"+ "#sticky-right { visibility: visible; }}"]; mw.loader.addStyleTag(stickyScrollBackgroundFix.join(" ")); }