mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
use ma0646 tabulator scroll fix on students/prestudents list
This commit is contained in:
@@ -178,6 +178,14 @@ export default {
|
||||
event: 'rowSelectionChanged',
|
||||
handler: this.rowSelectionChanged
|
||||
},
|
||||
{
|
||||
event: 'dataLoading',
|
||||
handler: this.handleDataLoading
|
||||
},
|
||||
{
|
||||
event: 'renderComplete',
|
||||
handler: this.handleRenderComplete
|
||||
},
|
||||
{
|
||||
event: 'dataProcessed',
|
||||
handler: (data) => {
|
||||
@@ -226,7 +234,10 @@ export default {
|
||||
tagEndpoint: ApiTag,
|
||||
currentEndpoint: null,
|
||||
headerFilterActive: false,
|
||||
dragSource: []
|
||||
dragSource: [],
|
||||
oldScrollUrl: '',
|
||||
oldScrollLeft: 0,
|
||||
oldScrollTop: 0
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -567,6 +578,24 @@ export default {
|
||||
|
||||
this.dragSource = (isAlreadySelected && this.selected?.length) ? this.selected : [data];
|
||||
},
|
||||
handleDataLoading() {
|
||||
this.oldScrollLeft = this.$refs.table.tabulator.rowManager.scrollLeft;
|
||||
this.oldScrollTop = this.$refs.table.tabulator.rowManager.scrollTop;
|
||||
},
|
||||
handleRenderComplete() {
|
||||
const table = this.$refs.table.tabulator.element.querySelector('.tabulator-tableholder');
|
||||
if(table) {
|
||||
const curAjaxUrl = this.$refs.table.tabulator.getAjaxUrl();
|
||||
if(this.oldScrollUrl === curAjaxUrl) {
|
||||
table.scrollLeft = this.oldScrollLeft;
|
||||
table.scrollTop = this.oldScrollTop;
|
||||
} else {
|
||||
this.oldScrollLeft = table.scrollLeft;
|
||||
this.oldScrollTop = table.scrollTop;
|
||||
}
|
||||
this.oldScrollUrl = this.$refs.table.tabulator.getAjaxUrl();
|
||||
}
|
||||
},
|
||||
},
|
||||
// TODO(chris): focusin, focusout, keydown and tabindex should be in the filter component
|
||||
// TODO(chris): filter component column chooser has no accessibilty features
|
||||
|
||||
Reference in New Issue
Block a user