mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-02 13:12:13 +08:00
fixes bug with long text in parse records modal [fixes SCI-1392]
This commit is contained in:
parent
b5649d3d5b
commit
a2e1aa5b36
4 changed files with 31 additions and 10 deletions
|
@ -1,7 +1,20 @@
|
|||
//= require repositories/import/records_importer.js
|
||||
(function() {
|
||||
(function(global) {
|
||||
'use strict';
|
||||
|
||||
global.pageReload = function() {
|
||||
animateSpinner();
|
||||
location.reload();
|
||||
}
|
||||
|
||||
function reloadOnHidden() {
|
||||
$('#modal-import-records')
|
||||
.on('hidden.bs.modal', function() {
|
||||
animateSpinner();
|
||||
location.reload();
|
||||
});
|
||||
}
|
||||
|
||||
function initImportRecordsModal() {
|
||||
$('#importRecordsButton').off().on('click', function() {
|
||||
$('#modal-import-records').modal('show');
|
||||
|
@ -13,7 +26,12 @@
|
|||
$('#form-records-file').on('ajax:success', function(ev, data) {
|
||||
$('#modal-import-records').modal('hide');
|
||||
$(data.html).appendTo('body').promise().done(function() {
|
||||
$('#parse-records_modal').modal('show');
|
||||
$('#parse-records_modal')
|
||||
.modal('show')
|
||||
.on('hidden.bs.modal', function() {
|
||||
animateSpinner();
|
||||
location.reload();
|
||||
});
|
||||
repositoryRecordsImporter();
|
||||
});
|
||||
});
|
||||
|
@ -34,6 +52,7 @@
|
|||
pane.tab('show').promise().done(function() {
|
||||
initImportRecordsModal();
|
||||
});
|
||||
reloadOnHidden()
|
||||
},
|
||||
error: function (error) {
|
||||
// TODO
|
||||
|
@ -63,4 +82,4 @@
|
|||
loadRepositoryTab();
|
||||
initImportRecordsModal();
|
||||
});
|
||||
})();
|
||||
})(window);
|
||||
|
|
|
@ -2120,3 +2120,7 @@ th.custom-field .modal-tooltiptext {
|
|||
.my_module-state-buttons {
|
||||
padding-top: 6px;
|
||||
}
|
||||
|
||||
.parse-records-table {
|
||||
max-height: 200px;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close" onClick="pageReload()"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><%= t('repositories.modal_import.title') %></h4>
|
||||
<%= t("repositories.modal_import.notice") %>
|
||||
</div>
|
||||
|
@ -15,7 +15,7 @@
|
|||
<%= f.file_field :file %>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><%= t('general.cancel')%></button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal" onClick="pageReload()"><%= t('general.cancel')%></button>
|
||||
<input type="submit" class="btn btn-primary" value="<%= t("repositories.modal_import.upload") %>"</input>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close" onClick="pageReload()"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="parse-modal-title"><%= t('repositories.modal_parse.title') %></h4>
|
||||
</div>
|
||||
<%= bootstrap_form_tag(url: import_records_repository_path(@import_data.repository, format: :json),
|
||||
|
@ -15,7 +15,7 @@
|
|||
<div class="modal-body">
|
||||
<h4><%= t("teams.parse_sheet.help_text") %></h4>
|
||||
<div style="overflow-x: scroll">
|
||||
<table class="table" style="display: block">
|
||||
<table class="table parse-records-table" style="display: block">
|
||||
<thead>
|
||||
<th style="min-width: 100px">
|
||||
<p><%= t("teams.parse_sheet.scinote_columns_html") %></p>
|
||||
|
@ -62,12 +62,10 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><%= t('general.cancel')%></button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal" onClick="pageReload()"><%= t('general.cancel')%></button>
|
||||
<input type="submit" class="btn btn-primary" value="<%= t('repositories.modal_parse.title') %>"</input>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= javascript_include_tag('samples/samples_importer') %>
|
||||
|
|
Loading…
Reference in a new issue