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