Jump to content

User:PleaseStand/hide-vector-sidebar.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by PleaseStand (talk | contribs) at 02:01, 2 May 2010 (Creating script). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
function hideSidebar() {
	jQuery("#panel").css("display", "none");
	jQuery("#content").css("margin-left", "0");
	jQuery("#left-navigation").css("left", "0");
	jQuery("#ca-sidebar a").attr("href", "javascript:showSidebar()").text("Show sidebar");
}
function showSidebar() {
	jQuery("#panel").css("display", "");
	jQuery("#content").css("margin-left", "");
	jQuery("#left-navigation").css("left", "");
	jQuery("#ca-sidebar a").attr("href", "javascript:hideSidebar()").text("Hide sidebar");
}
hookEvent("load", function() {
	addPortletLink("p-views", "javascript:hideSidebar()", "Hide sidebar", "ca-sidebar", "Hide/show the navigation links", "h")
});