diff mbox

[Branch,~linaro-validation/lava-server/trunk] Rev 267: Simplify the sidebar.

Message ID 20111021004613.12801.78428.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Zygmunt Krynicki Oct. 21, 2011, 12:46 a.m. UTC
------------------------------------------------------------
revno: 267
committer: Zygmunt Krynicki <zygmunt.krynicki@linaro.org>
branch nick: lava-server
timestamp: Fri 2011-10-21 01:30:06 +0200
message:
  Simplify the sidebar.
  
  Remove dock/undock feature
  Remove pin/unpin feature
  Show the sidebar automatically
modified:
  lava_server/templates/layouts/content_with_sidebar.html


--
lp:lava-server
https://code.launchpad.net/~linaro-validation/lava-server/trunk

You are subscribed to branch lp:lava-server.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-server/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'lava_server/templates/layouts/content_with_sidebar.html'
--- lava_server/templates/layouts/content_with_sidebar.html	2011-09-27 19:48:51 +0000
+++ lava_server/templates/layouts/content_with_sidebar.html	2011-10-20 23:30:06 +0000
@@ -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")