var action_data_from_params = $(this).data('action-data-from-params');
var selection_param = action_data.selection_param;
$modal.find('.modal-error').removeClass('hide').hide();
- $modal.find('.selectable.active[data-object-uuid]').each(function() {
+
+ $checked_selections = $modal.find('.persistent-selection:checked');
+ if ($checked_selections) {
+ $checked_selections.each(function() {
+ data.push({name: selection_param, value: $(this).attr('value')});
+ });
+ }
+
+ if (data.length == 0) { // no checked persistent selection
+ $modal.find('.selectable.active[data-object-uuid]').each(function() {
var val = $(this).attr('data-object-uuid');
data.push({name: selection_param, value: val});
- });
+ });
+ }
$.each($.extend({}, action_data, action_data_from_params),
function(key, value) {
if (value instanceof Array && key[-1] != ']') {
dn += '[value]'
end
- if dataclass == Collection
+ if (dataclass == Collection) or (dataclass == File)
selection_param = object.class.to_s.underscore + dn
display_value = attrvalue
if value_info.is_a?(Hash)
end
end
if (attr == :components) and (subattr.size > 2)
- chooser_title = "Choose a dataset for #{object.component_input_title(subattr[0], subattr[2])}:"
+ chooser_title = "Choose a #{dataclass == Collection ? 'dataset' : 'file'} for #{object.component_input_title(subattr[0], subattr[2])}:"
else
- chooser_title = "Choose a dataset:"
+ chooser_title = "Choose a #{dataclass == Collection ? 'dataset' : 'file'}:"
end
modal_path = choose_collections_path \
({ title: chooser_title,
</div>
<div class="collection_files_name">
- <% if !defined? no_checkboxes or !no_checkboxes %>
+ <%# if !defined? no_checkboxes or !no_checkboxes %>
<%= check_box_tag 'uuids[]', "#{@object.uuid}/#{file_path}", false, {
:class => 'persistent-selection',
:friendly_type => "File",
:title => "Include #{file_path} in your selections",
} %>
<span> </span>
- <% end %>
+ <%# end %>
<% if CollectionsHelper::is_image(filename) %>
<i class="fa fa-fw fa-bar-chart-o"></i> <%= filename %></div>
</div>