Sha256: f51538f331ebe7f80876a1d4de6c080bb0378481b7abd8b03ba8642a9d5d085b

Contents?: true

Size: 1.2 KB

Versions: 29

Compression:

Stored size: 1.2 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]'));
  // Refresh layout of foundation widgets
  $(document).foundation('reflow');

  var resizeSelect2DropDownsToFitModal = function(){
    $('.select2', modal).css('width', "100%");
  };
});

// 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

29 entries across 29 versions & 1 rubygems

Version Path
renalware-core-2.0.142 app/assets/javascripts/renalware/components/dialogs.js.erb
renalware-core-2.0.141 app/assets/javascripts/renalware/components/dialogs.js.erb
renalware-core-2.0.140 app/assets/javascripts/renalware/components/dialogs.js.erb
renalware-core-2.0.139 app/assets/javascripts/renalware/components/dialogs.js.erb
renalware-core-2.0.138 app/assets/javascripts/renalware/components/dialogs.js.erb
renalware-core-2.0.137 app/assets/javascripts/renalware/components/dialogs.js.erb
renalware-core-2.0.136 app/assets/javascripts/renalware/components/dialogs.js.erb
renalware-core-2.0.135 app/assets/javascripts/renalware/components/dialogs.js.erb
renalware-core-2.0.134 app/assets/javascripts/renalware/components/dialogs.js.erb
renalware-core-2.0.133 app/assets/javascripts/renalware/components/dialogs.js.erb
renalware-core-2.0.132 app/assets/javascripts/renalware/components/dialogs.js.erb
renalware-core-2.0.131 app/assets/javascripts/renalware/components/dialogs.js.erb
renalware-core-2.0.130 app/assets/javascripts/renalware/components/dialogs.js.erb
renalware-core-2.0.129 app/assets/javascripts/renalware/components/dialogs.js.erb
renalware-core-2.0.128 app/assets/javascripts/renalware/components/dialogs.js.erb
renalware-core-2.0.127 app/assets/javascripts/renalware/components/dialogs.js.erb
renalware-core-2.0.126 app/assets/javascripts/renalware/components/dialogs.js.erb
renalware-core-2.0.125 app/assets/javascripts/renalware/components/dialogs.js.erb
renalware-core-2.0.124 app/assets/javascripts/renalware/components/dialogs.js.erb
renalware-core-2.0.123 app/assets/javascripts/renalware/dialogs.js.erb