scinote-web/app/views/protocols/protocolsio_import_create.js.erb

28 lines
1.2 KiB
Text
Raw Normal View History

<% 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');
<% else %>
$('#modal-import-json-protocol').modal('hide');
2017-09-22 22:02:56 +08:00
<% if remotipart_submitted? %> <%# a workaround to a bug with remotipart, that caused alot of headache, courtesy of github.com/dhampik %>
2017-10-08 02:47:05 +08:00
$('#protocolsio-preview-modal-target').html(
"<%= j "#{render(:partial => 'protocols/import_export/import_json_protocol_preview_modal')}" %>"
);
<% else %>
2017-10-08 02:47:05 +08:00
$('#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 %>