Sha256: c2cb476781c46b47e4af47da6224d10e346732f72afc9e085e3b8114e7e75b41

Contents?: true

Size: 1.01 KB

Versions: 11

Compression:

Stored size: 1.01 KB

Contents

Spotlight.onLoad(function() {
  $("#another-email").on("click", function() {
    var container = $(this).closest('.form-group');
    var contacts = container.find('.contact');
    var input_container = contacts.first().clone();

    // wipe out any values from the inputs
    input_container.find('input').each(function() {
      $(this).val('');
      $(this).attr('id', $(this).attr('id').replace('0', contacts.length));
      $(this).attr('name', $(this).attr('name').replace('0', contacts.length));
    });

    input_container.find('.first-row-only').remove();

    // bootstrap does not render input-groups with only one value in them correctly.
    input_container.find('.input-group input:only-child').closest('.input-group').removeClass('input-group');

    $(input_container).insertAfter(contacts.last());
  });

  $('.btn-with-tooltip').tooltip();

  // Put focus in saved search title input when Save this search modal is shown
  $('#save-modal').on('shown.bs.modal', function () {
      $('#search_title').focus();
  })
});

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
blacklight-spotlight-0.8.0 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-0.7.2 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-0.7.1 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-0.7.0 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-0.6.0 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-0.5.0 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-0.4.1 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-0.3.1 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-0.3.0 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-0.2.0 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-0.1.0 app/assets/javascripts/spotlight/exhibits.js