mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-25 10:54:18 +00:00
First works on adding select to joblist
This commit is contained in:
parent
86318b9a7d
commit
526fd1769e
@ -9,6 +9,7 @@ class JobList extends ResourceList {
|
|||||||
super(listContainerElement, options);
|
super(listContainerElement, options);
|
||||||
this.listjs.list.addEventListener('click', (event) => {this.onClick(event)});
|
this.listjs.list.addEventListener('click', (event) => {this.onClick(event)});
|
||||||
this.isInitialized = false;
|
this.isInitialized = false;
|
||||||
|
this.selectedItemIds = new Set();
|
||||||
this.userId = listContainerElement.dataset.userId;
|
this.userId = listContainerElement.dataset.userId;
|
||||||
if (this.userId === undefined) {return;}
|
if (this.userId === undefined) {return;}
|
||||||
app.subscribeUser(this.userId).then((response) => {
|
app.subscribeUser(this.userId).then((response) => {
|
||||||
@ -25,6 +26,12 @@ class JobList extends ResourceList {
|
|||||||
get item() {
|
get item() {
|
||||||
return `
|
return `
|
||||||
<tr class="list-item clickable hoverable service-scheme">
|
<tr class="list-item clickable hoverable service-scheme">
|
||||||
|
<td>
|
||||||
|
<label class="list-action-trigger" data-list-action="select">
|
||||||
|
<input class="select-checkbox" type="checkbox">
|
||||||
|
<span class="disable-on-click"></span>
|
||||||
|
</label>
|
||||||
|
</td>
|
||||||
<td><a class="btn-floating"><i class="nopaque-icons service-icons" data-service="inherit"></i></a></td>
|
<td><a class="btn-floating"><i class="nopaque-icons service-icons" data-service="inherit"></i></a></td>
|
||||||
<td><b class="title"></b><br><i class="description"></i></td>
|
<td><b class="title"></b><br><i class="description"></i></td>
|
||||||
<td><span class="badge new job-status-color job-status-text status" data-badge-caption=""></span></td>
|
<td><span class="badge new job-status-color job-status-text status" data-badge-caption=""></span></td>
|
||||||
@ -61,6 +68,12 @@ class JobList extends ResourceList {
|
|||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th>
|
||||||
|
<label class="selection-action-trigger" data-selection-action="select-all">
|
||||||
|
<input class="select-all-checkbox" type="checkbox">
|
||||||
|
<span></span>
|
||||||
|
</label>
|
||||||
|
</th>
|
||||||
<th>Service</th>
|
<th>Service</th>
|
||||||
<th>Title and Description</th>
|
<th>Title and Description</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
@ -133,6 +146,15 @@ class JobList extends ResourceList {
|
|||||||
window.location.href = `/jobs/${itemId}`;
|
window.location.href = `/jobs/${itemId}`;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'select': {
|
||||||
|
if (event.target.checked) {
|
||||||
|
this.selectedItemIds.add(itemId);
|
||||||
|
} else {
|
||||||
|
this.selectedItemIds.delete(itemId);
|
||||||
|
}
|
||||||
|
this.renderingItemSelection();
|
||||||
|
break;
|
||||||
|
}
|
||||||
default: {
|
default: {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user