Sha256: 13cf38e9bb78f01fe9f6d1abcc2ecae8c0adcc32db0a9cb91bfdf1a9294860e8

Contents?: true

Size: 1.02 KB

Versions: 5

Compression:

Stored size: 1.02 KB

Contents

// Disable animations during tests to increase stability
<% reveal_animation = Rails.env.test? ? 'none' : 'fadeAndPop' %>

$(document).foundation({
    reveal: {
        animation: '<%= reveal_animation %>',
        animation_speed: 200,
        close_on_background_click: false,
        close_on_esc: true,
        dismiss_modal_class: "reveal-modal-close"
    }
});

// Honour any html autofocus attributes on inputs inside a modal dialog
$(document).on('opened.fndtn.reveal', '[data-reveal]', function () {
  var modal = $(this);
  modal.find('[autofocus]').focus();
  $('form[data-client-side-validations]').enableClientSideValidations();
  $('.searchable_select', modal).select2();
  // If a modal is launched again, ensure the submit button is re-enabled.
  $.rails.enableFormElement($('input[data-disable-with]'));
});

// If there was an error submitting a modal form, be sure to re-enable the submit button
$(document).on('ajaxError', function(event, xhr, status, error) {
  $.rails.enableFormElement($('input[data-disable-with]'));
});

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.beta9 app/assets/javascripts/renalware/dialogs.js.erb
renalware-core-2.0.0.pre.beta8 app/assets/javascripts/renalware/dialogs.js.erb
renalware-core-2.0.0.pre.beta7 app/assets/javascripts/renalware/dialogs.js.erb
renalware-core-2.0.0.pre.beta6 app/assets/javascripts/renalware/dialogs.js.erb
renalware-core-2.0.0.pre.beta5 app/assets/javascripts/renalware/dialogs.js.erb