=== modified file 'lava_server/templates/layouts/content_with_sidebar.html'
@@ -18,16 +18,6 @@
$(window).load(function() {
var preferDockedCookieName = "lava-server-prefer-docked";
var sidebar = $("#lava-server-sidebar");
- var dock = $("<span/>")
- .button({
- label: "Dock the sidebar",
- icons: { secondary: "ui-icon-circle-triangle-e" }
- })
- .css("float", "right")
- .prependTo(sidebar)
- .click(function() {
- dock_the_sidebar();
- });
function dock_the_sidebar() {
var user_box = $("#lava-server-user-box");
@@ -37,8 +27,6 @@
var base_margin = (
$("#lava-server-content").outerWidth(true)
- $("#lava-server-content").outerWidth(false)) / 2;
- // Remove the 'try new sidebar' button
- dock.hide();
// As for the sidebar
sidebar
@@ -55,61 +43,14 @@
content.css("marginRight", base_margin + "px");
},
onDestroy: function() {
- dock.show();
user_box.prependTo(header);
content.css("marginRight", base_margin + "px");
sidebar.addClass("classic")
- },
- onPin: function() {
- var heart = $("#heart");
- if (!heart.attr("checked")) {
- heart.attr("checked", "checked");
- heart.change(); // jQuery does not seem to fire this manually.
- heart.parent("div").effect("highlight", {}, 3000);
- }
- },
- extraControls: [
- // Undock button
- $("<span/>", {
- title: "Undock the sidebar"
- })
- .css("float", "left")
- .button({
- label: "Undock",
- text: false,
- icons: { primary: 'ui-icon-circle-triangle-w' }
- })
- .click(function () { sidebar.sidebar("destroy"); }),
- // Preferences
- $('<div/>')
- .css({
- textAlign: "left",
- marginTop: "1ex"
- })
- .append(
- $('<input/>', {
- type: "checkbox",
- checked: $.cookie(preferDockedCookieName, {path: '/'}) == 'true',
- id: "heart",
- title: "Dock the sidebar automatically"
- })
- .change(function() {
- $.cookie(preferDockedCookieName, $(this).attr("checked") ? true : '', {path: '/'})
- })
- )
- .append(
- $('<label/>', { "for": "heart" })
- .append($("<span/>")
- .text("Dock the sidebar automatically")
- )
- ),
- ]
+ }
});
}
- if ($.cookie(preferDockedCookieName) == "true") {
- dock_the_sidebar();
- }
+ dock_the_sidebar();
// Collapse help_text items to a clickable question mark
$("#lava-server-sidebar dd p.help_text")