fixes repository table on sidebar toggle [fixes SCI-2384]

This commit is contained in:
zmagod 2018-06-08 10:58:28 +02:00
parent 1bc869d4ca
commit b7ecf09963
3 changed files with 24 additions and 5 deletions

View file

@ -1,10 +1,15 @@
(function() {
'use strict';
// initialze repository datatable
$(document).ready(function() {
function initTable() {
RepositoryDatatable.destroy()
RepositoryDatatable.init($('#content').attr('data-repo-id'));
RepositoryDatatable.redrawTableOnSidebarToggle();
}
// initialze repository datatable
$(document).ready(function() {
initTable()
onClickToggleAssignedRecords();
});
})();

View file

@ -1256,8 +1256,17 @@ var RepositoryDatatable = (function(global) {
TABLE_ID = '';
}
function redrawTableOnSidebarToggle() {
$('#sidebar-arrow').on('click', function() {
setTimeout(function() {
TABLE.draw();
}, 250);
});
}
return Object.freeze({
init: init,
destroy: destroy
destroy: destroy,
redrawTableOnSidebarToggle: redrawTableOnSidebarToggle
});
})(window);

View file

@ -8,6 +8,12 @@
});
}
function initTable() {
RepositoryDatatable.destroy();
RepositoryDatatable.init('#' + $('.repository-table table').attr('id'));
RepositoryDatatable.redrawTableOnSidebarToggle();
}
function _initParseRecordsModal() {
$('#form-records-file').on('ajax:success', function(ev, data) {
$('#modal-import-records').modal('hide');
@ -30,8 +36,7 @@
function initialzerRepositoryTable() {
initImportRecordsModal();
RepositoryDatatable.destroy();
RepositoryDatatable.init('#' + $('.repository-table table').attr('id'));
initTable();
}
$(document).ready(initialzerRepositoryTable);