applying the patch

This commit is contained in:
Miha Mencin 2020-01-17 14:04:25 +01:00
parent 17c643fb21
commit 88210bd812

View file

@ -149,7 +149,7 @@ var RepositoryDatatable = (function(global) {
function initRowSelection() { function initRowSelection() {
// Handle clicks on checkbox // Handle clicks on checkbox
$('.dt-body-center .repository-row-selector').change(function(ev) { $(TABLE_ID).on('change', '.repository-row-selector', function(ev) {
var $row; var $row;
var data; var data;
var rowId; var rowId;
@ -247,9 +247,7 @@ var RepositoryDatatable = (function(global) {
if ($('#assigned').text().length === 0) { if ($('#assigned').text().length === 0) {
TABLE.column(1).visible(false); TABLE.column(1).visible(false);
} }
TABLE.ajax.reload(function() { TABLE.ajax.reload(null, false);
initRowSelection();
}, false);
changeToViewMode(); changeToViewMode();
SmartAnnotation.closePopup(); SmartAnnotation.closePopup();
animateSpinner(null, false); animateSpinner(null, false);
@ -488,7 +486,6 @@ var RepositoryDatatable = (function(global) {
// Show number of selected rows near pages info // Show number of selected rows near pages info
$('#repository-table_info').append('<span id="selected_info"></span>'); $('#repository-table_info').append('<span id="selected_info"></span>');
$('#selected_info').html(' (' + rowsSelected.length + ' entries selected)'); $('#selected_info').html(' (' + rowsSelected.length + ' entries selected)');
initRowSelection();
}, },
preDrawCallback: function() { preDrawCallback: function() {
animateSpinner(this); animateSpinner(this);
@ -521,8 +518,7 @@ var RepositoryDatatable = (function(global) {
fnInitComplete: function() { fnInitComplete: function() {
var tableLengthSelect = $('.dataTables_length select'); var tableLengthSelect = $('.dataTables_length select');
var tableFilterInput = $('.dataTables_filter input'); var tableFilterInput = $('.dataTables_filter input');
initRowSelection();
bindExportActions();
disableCheckboxToggleOnAssetDownload(); disableCheckboxToggleOnAssetDownload();
FilePreviewModal.init(); FilePreviewModal.init();
initHeaderTooltip(); initHeaderTooltip();
@ -587,14 +583,13 @@ var RepositoryDatatable = (function(global) {
$(this).parent().find('.repository-row-selector').trigger('click'); $(this).parent().find('.repository-row-selector').trigger('click');
}); });
TABLE.on('column-reorder', function() {
initRowSelection();
});
$('#assignRepositories, #unassignRepositories').click(function() { $('#assignRepositories, #unassignRepositories').click(function() {
animateLoading(); animateLoading();
}); });
initRowSelection();
bindExportActions();
return TABLE; return TABLE;
} }
@ -612,24 +607,16 @@ var RepositoryDatatable = (function(global) {
}); });
$('#assigned-repo-records').on('click', function() { $('#assigned-repo-records').on('click', function() {
var promiseReload;
viewAssigned = 'assigned'; viewAssigned = 'assigned';
promiseReload = new Promise(function(resolve) { return new Promise(function(resolve) {
resolve(TABLE.ajax.reload()); resolve(TABLE.ajax.reload());
}); });
promiseReload.then(function() {
initRowSelection();
});
}); });
$('#all-repo-records').on('click', function() { $('#all-repo-records').on('click', function() {
var promiseReload;
viewAssigned = 'all'; viewAssigned = 'all';
promiseReload = new Promise(function(resolve) { return new Promise(function(resolve) {
resolve(TABLE.ajax.reload()); resolve(TABLE.ajax.reload());
}); });
promiseReload.then(function() {
initRowSelection();
});
}); });
}; };