mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-18 05:20:54 +08:00
fixes repository table on sidebar toggle [fixes SCI-2384]
This commit is contained in:
parent
1bc869d4ca
commit
b7ecf09963
3 changed files with 24 additions and 5 deletions
|
@ -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();
|
||||
});
|
||||
})();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue