$('#modal-import-json-protocol').on('hidden.bs.modal', function () { $('#pio_no_file_error_span').empty(); }) <% if @protocolsio_too_big %> $('#modal-import-json-protocol').modal('hide'); HelperModule.flashAlertMsg(' <%= t('my_modules.protocols.load_from_file_size_error', size: Constants::FILE_MAX_SIZE_MB ) %>','danger'); <% elsif @protocolsio_invalid_file %> $('#modal-import-json-protocol').modal('hide'); HelperModule.flashAlertMsg(' <%= t('my_modules.protocols.load_from_file_invalid_error') %>','danger'); <% elsif @protocolsio_no_file %> $('#pio_no_file_error_span').addClass('has-error').html(' <%= t('teams.parse_sheet.errors.no_file_selected') %>'); <% @protocolsio_no_file = false %> <% else %> $('#modal-import-json-protocol').modal('hide'); <% if remotipart_submitted? %> <%# a workaround to a bug with remotipart, that caused alot of headache, courtesy of github.com/dhampik %> $('#protocolsio-preview-modal-target').html( "<%= j "#{render(:partial => 'protocols/import_export/import_json_protocol_preview_modal')}" %>" ); <% else %> $('#protocolsio-preview-modal-target').html( "<%= j render(:partial => 'protocols/import_export/import_json_protocol_preview_modal') %>" ); <% end %> $('#modal-import-json-protocol-preview').modal('show'); $('.modal').on('hidden.bs.modal', function (e) { if($('.modal').hasClass('in')) { $('body').addClass('modal-open'); } }); <% end %>