couple of things. Removed spurious puts.
}
}).
on('ajaxSend', function(e, xhr) {
- // map jquery event to rails event
+ // jQuery triggers 'ajaxSend' event when starting an ajax call, but
+ // rails-generated ajax triggers generate 'ajax:send'. Workbench
+ // event listeners currently expect 'ajax:send', so trigger the
+ // rails event in response to the jQuery one.
$(document).trigger('ajax:send');
}).
on('ajaxComplete', function(e, xhr) {
- // map jquery event to rails event
+ // See comment above about ajaxSend/ajax:send
$(document).trigger('ajax:complete');
}).
on('click', '.removable-tag a', function(e) {
if ($this.hasClass('active')) {
$(".modal-dialog-preview-pane").html('<img src="/assets/ajax-loader.gif"></img>');
- $.ajax($(this).attr('data-preview-href'),
- {dataType: "html"}).done(function(data, status, jqxhr) {
- $(".modal-dialog-preview-pane").html(data);
- });
+ $.ajax($this.attr('data-preview-href'),
+ {dataType: "html"}).
+ done(function(data, status, jqxhr) {
+ $(".modal-dialog-preview-pane").html(data);
+ }).
+ fail(function(data, status, jqxhr) {
+ $(".modal-dialog-preview-pane").text('Preview load failed.');
+ });
}
}).on('click', '.modal button[data-action-href]', function() {
params[:limit] ||= 40
if !@objects
if params[:project_uuid] and !params[:project_uuid].empty?
+ # We want the chooser to show objects of the controllers's model_class
+ # type within a specific project specified by project_uuid, so fetch the
+ # project and request the contents of the project filtered on the
+ # controllers's model_class kind.
@objects = Group.find(params[:project_uuid]).contents({:filters => [['uuid', 'is_a', "arvados\##{ArvadosApiClient.class_kind(model_class)}"]]})
end
find_objects_for_index if !@objects
url_for(offset: next_page_offset, partial: true))
@name_links = @objects
- puts "and the result is (1) ", @name_links.results
-
@objects = Collection.
filter([['uuid','in',@name_links.collect(&:head_uuid)]])
super
-<% puts "and the result is (2) ", @name_links.results, "objects is #{@objects}" %>
<% @name_links.each do |name_link| %>
<% puts "looking up #{name_link.head_uuid}" %>
<% if (object = get_object(name_link.head_uuid)) %>