Sha256: 5a731a1fea4a2200315fde475fe74c63ed897669659c958e2ba07a414fb1084c

Contents?: true

Size: 599 Bytes

Versions: 17

Compression:

Stored size: 599 Bytes

Contents

Blacklight.onLoad(function () {

  // change the action based which collection is selected
  // This expects the form to have a path that includes the string 'collection_replace_id'
  $('[data-behavior="updates-collection"]').on('click', function() {
      var string_to_replace = "collection_replace_id"
      var form = $(this).closest("form");
      var collection_id = $(".collection-selector:checked")[0].value;
      form[0].action = form[0].action.replace(string_to_replace, collection_id);
      form.append('<input type="hidden" value="add" name="collection[members]"></input>');
  });
});

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
hyrax-1.1.1 app/assets/javascripts/hyrax/collections.js
hyrax-2.0.3 app/assets/javascripts/hyrax/collections.js
hyrax-1.1.0 app/assets/javascripts/hyrax/collections.js
hyrax-2.0.2 app/assets/javascripts/hyrax/collections.js
hyrax-2.0.1 app/assets/javascripts/hyrax/collections.js
hyrax-2.0.0 app/assets/javascripts/hyrax/collections.js
hyrax-2.0.0.rc3 app/assets/javascripts/hyrax/collections.js
hyrax-2.0.0.rc2 app/assets/javascripts/hyrax/collections.js
hyrax-2.0.0.rc1 app/assets/javascripts/hyrax/collections.js
hyrax-1.0.5 app/assets/javascripts/hyrax/collections.js
hyrax-2.0.0.beta5 app/assets/javascripts/hyrax/collections.js
hyrax-2.0.0.beta4 app/assets/javascripts/hyrax/collections.js
hyrax-2.0.0.beta3 app/assets/javascripts/hyrax/collections.js
hyrax-2.0.0.beta2 app/assets/javascripts/hyrax/collections.js
hyrax-2.0.0.beta1 app/assets/javascripts/hyrax/collections.js
hyrax-1.0.4 app/assets/javascripts/hyrax/collections.js
hyrax-1.0.3 app/assets/javascripts/hyrax/collections.js