Merge branch 'master' into 2060-edit-tags-in-workbench
authorTom Clegg <tom@curoverse.com>
Sun, 16 Feb 2014 08:26:54 +0000 (00:26 -0800)
committerTom Clegg <tom@curoverse.com>
Sun, 16 Feb 2014 08:26:54 +0000 (00:26 -0800)
Conflicts:
apps/workbench/app/assets/javascripts/application.js
apps/workbench/app/assets/stylesheets/application.css.scss

1  2 
apps/workbench/app/assets/javascripts/application.js
apps/workbench/app/assets/stylesheets/application.css.scss

index 3d2914b18c55ccbb198a764303a57198e8e24177,927e7ae1defc44b269bfa38c36380313c9c21dee..4d9c1b8be3defc57579d8469a7aa47217cc7ade3
@@@ -43,25 -43,35 +43,51 @@@ jQuery(function($)
      });
      $(document).
          on('ajax:send', function(e, xhr) {
-             $('.loading').show();
+             $('.loading').fadeTo('fast', 1);
          }).
          on('ajax:complete', function(e, status) {
-             $('.loading').hide();
+             $('.loading').fadeOut('fast', 0);
 +        }).
 +        on('click', '.removable-tag a', function(e) {
 +            $(this).parents('[data-tag-link-uuid]').eq(0).next().andSelf().remove();
 +        }).
 +        on('click', 'a.add-tag-button', function(e) {
 +            new_tag = window.prompt("Add tag for collection "+
 +                                    $(this).parents('tr').attr('data-object-uuid'),
 +                                    "");
 +            if (new_tag != null) {
 +                $(this).
 +                    parent().
 +                    find('>span').
 +                    append($('<span class="label label-info removable-tag" data-tag-link-uuid=""></span>').text(new_tag).append('&nbsp;<a>&times;</a>')).
 +                    append('<br/>');
 +            }
 +            return false;
          });
+     HeaderRowFixer = function(selector) {
+         var tables = $(selector);
+         this.duplicateTheadTr = function() {
+             $('>tbody', tables).each(function(){
+                 $(this).prepend($('thead>tr', this).clone().css('opacity:0'));
+             });
+         }
+         this.fixThead = function() {
+             tables.each(function() {
+                 var widths = [];
+                 $('> tbody > tr:eq(1) > td', this).each( function(i,v){
+                     widths.push($(v).width());
+                 });
+                 for(i=0;i<widths.length;i++) {
+                     $('thead th:eq('+i+')', this).width(widths[i]);
+                 }
+             });
+         }
+     }
+     var fixer = new HeaderRowFixer('.table-fixed-header-row');
+     fixer.fixThead();
+     fixer.duplicateTheadTr();
+     $(window).resize(function(){
+         fixer.fixThead();
+     });
  })(jQuery);
index c99295930944723c3c9fbb10fa18700bf28f5d66,5ada51a936a33d7e6fc3e622a443e63bc90ddd0c..a4163f8b3fe136c2456d530470a2e1fb9ec836b4
@@@ -126,15 -126,35 +126,46 @@@ ul.arvados-nav li ul li 
      display:inline-block;
  }
  
 +td.add-tag-button .add-tag-button {
 +    margin-top: 2px;
 +    opacity: 0;
 +}
 +td.add-tag-button:hover .add-tag-button {
 +    opacity: 1;
 +}
 +.removable-tag a {
 +    cursor: pointer;
 +}
++
+ li.notification {
+     padding: 10px;
+ }
+ .arvados-nav-container {
+     top: 70px; 
+     height: calc(100% - 70px); 
+     overflow: auto; 
+     z-index: 2;
+ }
+ .arvados-nav-active {
+     background: rgb(66, 139, 202);
+ }
+ .arvados-nav-active a {
+     color: white;
+ }
+ // See HeaderRowFixer in application.js
+ table.table-fixed-header-row {
+     width: 100%;
+     border-spacing: 0px;
+     margin:0;
+ }
+ table.table-fixed-header-row thead {
+     position:fixed;
+     background: #fff;
+ }
+ table.table-fixed-header-row tbody {
+     position:relative;
+     top:1.5em;
+ }