Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
HTML
<script>
 
	function hidePageTitle() {
		AJS.$("#splitter-content #title-text").css("display", "none");
		AJS.$("#splitter-content .aui-page-panel #content").css("width", "100%");
		AJS.$("#splitter-content .aui-page-panel #content").css("min-width", "100%");
		AJS.$("#splitter-content #main #main-header #title-heading #breadcrumb-section").css("margin-bottom", "20px");
		AJS.$("#splitter-content #main #main-header").css("width", "100%");
		AJS.$("#splitter-content #main #main-header").css("min-width", "100%");
 
		// Hide the breadcrumb
		AJS.$("div#breadcrumb-section").css("display", "none");
		
		// Increment the maximum width of the content
		AJS.$('#content .center').css("max-width", "1200px");
	}
 
	AJS.toInit(function () {
		
 		hidePageTitle();
 
		// Find out the initial value of the sidebar width and set a cookie
		jQuery.cookie("showsidebar", AJS.$("div#splitter-sidebar").width(), {path:'/' });
		// Find out the initial state of sidebar and set a cookie
		jQuery.cookie("resetsidebar", jQuery.cookie("doc-sidebar"), {path:'/' });

		// If the sidebar is visible, hide it and also the split bar
		if (AJS.$("div#splitter-sidebar").width() > 0) {
			AJS.$(".vsplitbar").hide();
			AJS.$("div#splitter-sidebar").width(0);
 
			// Expand the splitter contents to the whole browser window
			AJS.$('#splitter-content').css({'width':'100%', 'left':'0'});
		};

		AJS.$("#splitter-button").parent().hide();

		// The unload function runs when the user navigates away from the page
		jQuery(window).bind('beforeunload', function() {
			// Read the cookie to find out where the sidebar was originally
			var origstate = jQuery.cookie("showsidebar");
			
			// If the sidebar is now hidden and it wasn't originally, show it.
			if (AJS.$("div#splitter-sidebar").width() != origstate) {
				AJS.$(".vsplitbar").show();
				AJS.$("div#splitter-sidebar").width(origstate);
				AJS.$('#splitter-content').css({'width':'100%', 'left':'"+origstate+"'});
			};
 
			// Restore the status of the doc sidebar status cookie
			jQuery.cookie("doc-sidebar", jQuery.cookie("resetsidebar"), {path:'/'});
			
			// Delete the local cookies
			jQuery.cookie("showsidebar", null, {path:'/'});
			jQuery.cookie("resetsidebar", null, {path:'/'});
		});
	});

 </script>