mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-01 04:32:16 +08:00
Merge pull request #760 from mz3944/mz-SCI-1481
Fixed slow exporting of repositories - JS listeners which triggered f… [SCI-1481]
This commit is contained in:
commit
cf2b06d82f
1 changed files with 14 additions and 9 deletions
|
@ -728,21 +728,26 @@ var RepositoryDatatable = (function(global) {
|
||||||
if (rowsSelected.length === 1) {
|
if (rowsSelected.length === 1) {
|
||||||
$('#editRepositoryRecord').prop('disabled', false);
|
$('#editRepositoryRecord').prop('disabled', false);
|
||||||
$('#editRepositoryRecord').removeClass('disabled');
|
$('#editRepositoryRecord').removeClass('disabled');
|
||||||
|
|
||||||
|
// If we switched from 2 selections to 1, then this is not needed
|
||||||
|
var events = $._data($('#exportRepositoriesButton').get(0), 'events');
|
||||||
|
if (!events || !events.click) {
|
||||||
|
$('#exportRepositoriesButton').removeClass('disabled');
|
||||||
|
$('#exportRepositoriesButton').prop('disabled', false);
|
||||||
|
$('#exportRepositoriesButton').off('click').on('click', function() {
|
||||||
|
$('#exportRepositoryModal').modal('show');
|
||||||
|
});
|
||||||
|
$('#export-repositories').off('click').on('click', function() {
|
||||||
|
animateSpinner(null, true);
|
||||||
|
$('#form-export').submit();
|
||||||
|
});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$('#editRepositoryRecord').prop('disabled', true);
|
$('#editRepositoryRecord').prop('disabled', true);
|
||||||
$('#editRepositoryRecord').addClass('disabled');
|
$('#editRepositoryRecord').addClass('disabled');
|
||||||
}
|
}
|
||||||
$('#deleteRepositoryRecordsButton').prop('disabled', false);
|
$('#deleteRepositoryRecordsButton').prop('disabled', false);
|
||||||
$('#deleteRepositoryRecordsButton').removeClass('disabled');
|
$('#deleteRepositoryRecordsButton').removeClass('disabled');
|
||||||
$('#exportRepositoriesButton').removeClass('disabled');
|
|
||||||
$('#exportRepositoriesButton').prop('disabled', false);
|
|
||||||
$('#exportRepositoriesButton').on('click', function() {
|
|
||||||
$('#exportRepositoryModal').modal('show');
|
|
||||||
});
|
|
||||||
$('#export-repositories').on('click', function() {
|
|
||||||
animateSpinner(null, true);
|
|
||||||
$('#form-export').submit();
|
|
||||||
});
|
|
||||||
$('#assignRepositoryRecords').removeClass('disabled');
|
$('#assignRepositoryRecords').removeClass('disabled');
|
||||||
$('#assignRepositoryRecords').prop('disabled', false);
|
$('#assignRepositoryRecords').prop('disabled', false);
|
||||||
$('#unassignRepositoryRecords').removeClass('disabled');
|
$('#unassignRepositoryRecords').removeClass('disabled');
|
||||||
|
|
Loading…
Reference in a new issue