Forgot flash fail messagges, now added them for file too big and general error

This commit is contained in:
Zanz2 2017-10-27 00:17:42 +02:00
parent feb686b4ac
commit 4b837dbe9d
2 changed files with 6 additions and 4 deletions

View file

@ -1,7 +1,8 @@
<% if @protocolsio_too_big %>
alert('<%= I18n.t('my_modules.protocols.load_from_file_size_error',
size: Constants::FILE_MAX_SIZE_MB ) %>');
$('#modal-import-json-protocol').modal('hide');
HelperModule.flashAlertMsg(' <%= t('my_modules.protocols.load_from_file_size_error',
size: Constants::FILE_MAX_SIZE_MB ) %>','danger');
<% 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 %>

View file

@ -1,6 +1,7 @@
<% if @protocolsio_general_error %>
alert('<%= t('my_modules.protocols.load_from_file_protocol_general_error',
max: Constants::NAME_MAX_LENGTH, min: Constants::NAME_MIN_LENGTH) %>');
$('#modal-import-json-protocol-preview').modal('hide');
HelperModule.flashAlertMsg(' <%= t('my_modules.protocols.load_from_file_protocol_general_error',
max: Constants::NAME_MAX_LENGTH, min: Constants::NAME_MIN_LENGTH) %>', 'danger');
<% else %>
$('#modal-import-json-protocol-preview').modal('hide');
$('#protocols_io_form').trigger("reset");