Merge pull request #1197 from ZmagoD/zd_SCI_2384

fixes repository table on sidebar toggle [fixes SCI-2384]
This commit is contained in:
Zmago Devetak 2018-06-13 09:57:27 +02:00 committed by GitHub
commit 673410251d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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

@ -1259,8 +1259,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);