[ARVADOS] updated: 8c87d1cf55e096ce472fa9a749b60f2aab7fbb74
git at public.curoverse.com
git at public.curoverse.com
Sun Jul 27 15:34:39 EDT 2014
Summary of changes:
apps/workbench/app/assets/javascripts/filterable.js | 11 +++++++++++
apps/workbench/app/views/search/_choose_rows.html.erb | 4 ++--
2 files changed, 13 insertions(+), 2 deletions(-)
via 8c87d1cf55e096ce472fa9a749b60f2aab7fbb74 (commit)
from 4bbd2177505ff09d6d9e77d1a1ea80523fcfd395 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 8c87d1cf55e096ce472fa9a749b60f2aab7fbb74
Author: Tom Clegg <tom at curoverse.com>
Date: Sun Jul 27 15:34:31 2014 -0400
3235: Hide section header rows for empty sections. closes #3377
diff --git a/apps/workbench/app/assets/javascripts/filterable.js b/apps/workbench/app/assets/javascripts/filterable.js
index 76c5ac3..098c7ec 100644
--- a/apps/workbench/app/assets/javascripts/filterable.js
+++ b/apps/workbench/app/assets/javascripts/filterable.js
@@ -6,6 +6,7 @@ $(document).
data('q', q).
trigger('refresh');
}).on('refresh', '.filterable-container', function() {
+ var $container = $(this);
var q = $(this).data('q');
var filters = $(this).data('filters');
$('.filterable', this).hide().filter(function() {
@@ -26,6 +27,16 @@ $(document).
}
return pass;
}).show();
+
+ // Show/hide each section heading depending on whether any
+ // content rows are visible in that section.
+ $('.row[data-section-heading]', this).each(function(){
+ $(this).toggle($('.row.filterable[data-section-name="' +
+ $(this).attr('data-section-name') +
+ '"]:visible').length > 0);
+ });
+
+ // Load more content if the last result is showing.
$('.infinite-scroller').add(window).trigger('scroll');
}).on('change', 'select.filterable-control', function() {
var val = $(this).val();
diff --git a/apps/workbench/app/views/search/_choose_rows.html.erb b/apps/workbench/app/views/search/_choose_rows.html.erb
index 59b15ce..fdd3095 100644
--- a/apps/workbench/app/views/search/_choose_rows.html.erb
+++ b/apps/workbench/app/views/search/_choose_rows.html.erb
@@ -3,13 +3,13 @@
<% icon_class = fa_icon_class_for_class(object.class) %>
<% if object.class.to_s != current_class %>
<% current_class = object.class.to_s %>
- <div class="row class-separator">
+ <div class="row class-separator" data-section-heading="true" data-section-name="<%= object.class.to_s %>">
<div class="col-sm-12">
<%= object.class_for_display.pluralize.downcase %>
</div>
</div>
<% end %>
- <div class="row filterable selectable <%= 'multiple' if multiple %>" data-object-uuid="<%= object.uuid %>" data-preview-href="<%= chooser_preview_url_for object %>">
+ <div class="row filterable selectable <%= 'multiple' if multiple %>" data-section-name="<%= object.class.to_s %>" data-object-uuid="<%= object.uuid %>" data-preview-href="<%= chooser_preview_url_for object %>">
<div class="col-sm-12" style="overflow-x:hidden; white-space: nowrap">
<i class="fa fa-fw <%= icon_class %>"></i>
<% if object.respond_to?(:name) and object.name and object.name.length > 0 %>
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list