feat(course-teaser): no page reload on sorting

This commit is contained in:
Sarah Vaupel 2019-08-05 14:04:45 +02:00
parent 8ddd6aa001
commit 68b8d24681
2 changed files with 4 additions and 4 deletions

View File

@ -60,9 +60,9 @@ export class AsyncTable {
this._asyncTableHeader = this._element.dataset.asyncTableDbHeader;
}
const table = this._element.querySelector('table');
const table = this._element.querySelector('table, .div__course-teaser');
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;
@ -94,7 +94,7 @@ export class AsyncTable {
}
_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 }));
this._ths.forEach((th) => {

View File

@ -1,5 +1,5 @@
$newline never
<div .scrolltable>
<div .scrolltable .div__course-teaser *{dbsAttrs'}>
$maybe wHeaders' <- wHeaders
<div .course-teaser-header>
$forall widget <- wHeaders'