Sha256: 6b4a4103c20f665cbc43468e293f61de395fcd0912e35ec51cf4e73c52496f67

Contents?: true

Size: 1.41 KB

Versions: 54

Compression:

Stored size: 1.41 KB

Contents

Spotlight.onLoad(function() {

  // auto-fill the exhibit slug on the new exhibit form
  $('#new_exhibit').each(function() {
    $('#exhibit_title').on('change keyup', function() {
      $('#exhibit_slug').attr('placeholder', URLify($(this).val(), $(this).val().length));
    });

    $('#exhibit_slug').on('focus', function() {
      if ($(this).val() === '') {
        $(this).val($(this).attr('placeholder'));
      }
    });
  });

  $("#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

54 entries across 54 versions & 1 rubygems

Version Path
blacklight-spotlight-1.0.0 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-1.0.0.alpha2 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-1.0.0.alpha1 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-0.34.1 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-0.34.0 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-0.33.3 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-0.33.2 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-0.33.1 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-0.33.0 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-0.32.0 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-0.31.0 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-0.30.0 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-0.29.1 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-0.29.0 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-0.28.3 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-0.28.2 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-0.28.1 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-0.28.0 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-0.27.0 app/assets/javascripts/spotlight/exhibits.js
blacklight-spotlight-0.26.1 app/assets/javascripts/spotlight/exhibits.js