]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5052 Rework widgets drag'n'drop
authorStas Vilchik <vilchiks@gmail.com>
Tue, 11 Feb 2014 12:13:36 +0000 (18:13 +0600)
committerStas Vilchik <vilchiks@gmail.com>
Tue, 11 Feb 2014 12:13:36 +0000 (18:13 +0600)
Add an ability to move a widget below the lowest widget

sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb
sonar-server/src/main/webapp/javascripts/dashboard.js
sonar-server/src/main/webapp/stylesheets/dashboard.css

index c90aeae3a097f923fea8dd46d990029c33444ea6..c7e410e56481a7b73d0a1084ab479de619a66a7e 100644 (file)
@@ -26,8 +26,6 @@
   %>
     <div class="dashboard-column-wrapper" style="width: <%= columns[index-1] -%>;margin: 0 -1px 0 0;">
       <div class="dashboard-column" id="dashboard-column-<%= index -%>" style="margin: 0 <%= index<columns.size() ? "5px" : "0px" -%> 0 <%= index>1 ? "5px" : "0px" -%>;">
-        <div class="column-handle" style="display: none"></div>
-
         <%
            @dashboard.widgets.select { |widget| widget.column_index==index && widget.java_definition }.sort_by { |widget| widget.row_index }.each do |widget|
         %>
@@ -37,6 +35,7 @@
         <%
            end
         %>
+        <div class="column-handle" style="display: none"></div>
       </div>
     </div>
   <% end %>
index cc70df9bf8ab70d12e120b0de3be935c6fe75755..576dba7046df6801674f00b34eac22bfda7ccd80 100644 (file)
@@ -39,6 +39,7 @@
           .on('dragstart', function(e) {
             e.originalEvent.dataTransfer.setData('text/plain', 'drag');
             draggable = $(this);
+            columnHandle.show();
           })
           .on('dragover', function(e) {
             if (draggable.prop('id') !== $(this).prop('id')) {
index 2b996e164e7aef579f47cbbc84246205ac010bdf..710d6bb7fe22644cdd791370dbe2b9f700ce564d 100644 (file)
 }
 
 #dashboard .column-handle {
-  height: 100px;
+  height: 30px;
   width: 100%;
   margin: 0;
   padding: 0;
   text-align: center;
   font-size: x-large;
   vertical-align: middle;
-  color: #555;
+  background-color: #eee;
 }
 
 #dashboard .block {