feat(course-teaser): no page reload on sorting
This commit is contained in:
parent
8ddd6aa001
commit
68b8d24681
@ -60,9 +60,9 @@ export class AsyncTable {
|
|||||||
this._asyncTableHeader = this._element.dataset.asyncTableDbHeader;
|
this._asyncTableHeader = this._element.dataset.asyncTableDbHeader;
|
||||||
}
|
}
|
||||||
|
|
||||||
const table = this._element.querySelector('table');
|
const table = this._element.querySelector('table, .div__course-teaser');
|
||||||
if (!table) {
|
if (!table) {
|
||||||
throw new Error('Async Table utility needs a <table> in its element!');
|
throw new Error('Async Table utility needs a <table> or a <div .div__course-teaser> in its element!');
|
||||||
}
|
}
|
||||||
|
|
||||||
const rawTableId = table.id;
|
const rawTableId = table.id;
|
||||||
@ -94,7 +94,7 @@ export class AsyncTable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_setupSortableHeaders() {
|
_setupSortableHeaders() {
|
||||||
this._ths = Array.from(this._scrollTable.querySelectorAll('th.sortable'))
|
this._ths = Array.from(this._scrollTable.querySelectorAll('th.sortable, .course-header'))
|
||||||
.map((th) => ({ element: th }));
|
.map((th) => ({ element: th }));
|
||||||
|
|
||||||
this._ths.forEach((th) => {
|
this._ths.forEach((th) => {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
$newline never
|
$newline never
|
||||||
<div .scrolltable>
|
<div .scrolltable .div__course-teaser *{dbsAttrs'}>
|
||||||
$maybe wHeaders' <- wHeaders
|
$maybe wHeaders' <- wHeaders
|
||||||
<div .course-teaser-header>
|
<div .course-teaser-header>
|
||||||
$forall widget <- wHeaders'
|
$forall widget <- wHeaders'
|
||||||
|
|||||||
Reference in New Issue
Block a user