mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-10 00:11:22 +08:00
Merge pull request #5934 from artoscinote/ma_SCI_8984
Fix column resizing for existing inventories with no colSize data [SCI-8984]
This commit is contained in:
commit
d0f44bb9fd
1 changed files with 5 additions and 3 deletions
|
|
@ -185,7 +185,7 @@ var RepositoryDatatable = (function(global) {
|
||||||
$('#saveRecord').attr('disabled', false);
|
$('#saveRecord').attr('disabled', false);
|
||||||
$(TABLE_WRAPPER_ID).find('tr').removeClass('blocked');
|
$(TABLE_WRAPPER_ID).find('tr').removeClass('blocked');
|
||||||
|
|
||||||
if (TABLE.ColSizes) {
|
if (TABLE.ColSizes && TABLE.ColSizes.filter((s) => !!s).length > 0) {
|
||||||
$(TABLE_WRAPPER_ID).find('.table').addClass('table--resizable-columns');
|
$(TABLE_WRAPPER_ID).find('.table').addClass('table--resizable-columns');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -558,7 +558,9 @@ var RepositoryDatatable = (function(global) {
|
||||||
|
|
||||||
state.ColSizes = data;
|
state.ColSizes = data;
|
||||||
|
|
||||||
$(TABLE_WRAPPER_ID).find('.table').addClass('table--resizable-columns');
|
if (data.length > 0) {
|
||||||
|
$(TABLE_WRAPPER_ID).find('.table').addClass('table--resizable-columns');
|
||||||
|
}
|
||||||
|
|
||||||
updateColSizeMap(state);
|
updateColSizeMap(state);
|
||||||
|
|
||||||
|
|
@ -743,7 +745,7 @@ var RepositoryDatatable = (function(global) {
|
||||||
if (json.state.columns[7]) json.state.columns[7].visible = archived;
|
if (json.state.columns[7]) json.state.columns[7].visible = archived;
|
||||||
if (json.state.search) delete json.state.search;
|
if (json.state.search) delete json.state.search;
|
||||||
|
|
||||||
if (json.state.ColSizes) {
|
if (json.state.ColSizes && json.state.ColSizes.length > 0) {
|
||||||
$(TABLE_WRAPPER_ID).find('.table').addClass('table--resizable-columns');
|
$(TABLE_WRAPPER_ID).find('.table').addClass('table--resizable-columns');
|
||||||
TABLE.ColSizes = json.state.ColSizes;
|
TABLE.ColSizes = json.state.ColSizes;
|
||||||
updateColSizeMap(json.state);
|
updateColSizeMap(json.state);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue