Showing 1 changed files with 40 additions and 28 deletions
+40 -28
templates/compare.html.ep
... ...
@@ -66,6 +66,17 @@
66 66
       $('#compare-tab a').on('click', function () {
67 67
         $(this).tab('show');
68 68
       });
69
+      
70
+      $('#base-branch-btn').on('click', function () {
71
+        $('#base-branch-popup')
72
+          .css('display', 'block')
73
+          .css('top', '40px')
74
+          .css('left', '10px')
75
+        ;
76
+      });
77
+      $('#base-branch-close').on('click', function () {
78
+        $('#base-branch-popup').css('display', 'none');
79
+      });
69 80
     });
70 81
   % end
71 82
 
... ...
@@ -76,14 +87,14 @@
76 87
     %= include '/include/code_menu', display => 'files';
77 88
     
78 89
     <h2>Compare View</h2>
79
-    <div class="well" style="padding:9px 10px 9px 10px;margin-bottom:5px">
90
+    <div class="well" style="padding:9px 10px 9px 10px;margin-bottom:5px;position:relative">
80 91
       <div class="row">
81 92
         <div class="span3">
82
-          <button class="btn" style="padding:2px 10px">
93
+          <button id="base-branch-btn" class="btn" style="padding:2px 10px">
83 94
             <%= $rev1 %>
84 95
           </button>
85 96
           ...
86
-          <button class="btn" style="padding:2px 10px">
97
+          <button id="compare-branch-btn" class="btn" style="padding:2px 10px">
87 98
             <%= $rev2 %>
88 99
           </button>
89 100
         </div>
... ...
@@ -91,35 +102,36 @@
91 102
           <button class="btn" style="padding:2px 10px">Edit</button>
92 103
         </div>
93 104
       </div>
94
-    </div>
95
-    <div id="base-branch-select" style="width:330px">
96
-      <div class="radius-top border-gray" style="background:#E6E6FA;padding:10px">
97
-        <div class="row">
98
-          <div class="span3">
99
-            <b>Choose a base branch</b>
100
-          </div>
101
-          <div class="text-right">
102
-            <i class="icon-remove-circle"></i>
105
+
106
+      <div id="base-branch-popup" style="display:none;width:330px;position:absolute">
107
+        <div class="radius-top border-gray" style="background:#E6E6FA;padding:10px">
108
+          <div class="row">
109
+            <div class="span3">
110
+              <b>Choose a base branch</b>
111
+            </div>
112
+            <div class="text-right">
113
+              <i id="base-branch-close" class="icon-remove-circle"></i>
114
+            </div>
103 115
           </div>
104 116
         </div>
105
-      </div>
106
-      <div class="border-gray" style="background:#F5F5F5;border-top:none;border-bottom:none;text-align:center;padding:10px 0">
107
-        %= text_field 'base-branch', style => 'margin-bottom:0;width:270px', placeholder => 'Branch, tag, commit, or history marker';
108
-      </div>
109
-      <div style="max-height:500px;overflow:auto;">
110
-      <ul class="nav nav-tabs nav-stacked">
111
-        % for (my $i = 0; $i < @$branches; $i++) {
112
-          % my $branch = $branches->[$i];
113
-            <li>
114
-              <a style="border-top-left-radius:0px;border-top-right-radius:0px;" href="<%= url_for("/$user/$project/compare/$branch->{name}...$rev2") %>">
115
-                <%= $branch->{name} %>
116
-              </a>
117
-            </li>
118
-        % }
119
-      </ul>
117
+        <div class="border-gray" style="background:#F5F5F5;border-top:none;border-bottom:none;text-align:center;padding:10px 0">
118
+          %= text_field 'base-branch', style => 'margin-bottom:0;width:270px', placeholder => 'Branch, tag, commit, or history marker';
119
+        </div>
120
+        <div style="background:white;max-height:500px;overflow:auto;">
121
+        <ul class="nav nav-tabs nav-stacked">
122
+          % for (my $i = 0; $i < @$branches; $i++) {
123
+            % my $branch = $branches->[$i];
124
+              <li>
125
+                <a style="border-top-left-radius:0px;border-top-right-radius:0px;" href="<%= url_for("/$user/$project/compare/$branch->{name}...$rev2") %>">
126
+                  <%= $branch->{name} %>
127
+                </a>
128
+              </li>
129
+          % }
130
+        </ul>
131
+        </div>
120 132
       </div>
121 133
     </div>
122
-    
134
+
123 135
     <div style="margin-bottom:20px">From here you can compare two points in history. You can even compare tag names and commits.</div>
124 136
     
125 137
     <hr style="margin-top:5px">