update clickable list item

This commit is contained in:
Inga Kirschnick 2023-06-07 13:49:07 +02:00
parent 4944d31dd5
commit 9ffc41a133
3 changed files with 6 additions and 16 deletions

View File

@ -32,7 +32,7 @@ class CorpusFileList extends ResourceList {
get item() {
return (values) => {
return `
<tr class="list-item">
<tr class="list-item clickable hoverable">
<td>
<label class="list-action-trigger ${this.hasPermissionView ? '' : 'hide'}" data-list-action="select">
<input class="select-checkbox" type="checkbox">
@ -79,7 +79,7 @@ class CorpusFileList extends ResourceList {
<thead>
<tr>
<th>
<label class="selection-action-trigger ${this.listContainerElement.dataset?.hasPermissionView == 'true' ? '' : 'hide'}" data-selection-action="select-all">
<label class="disable-on-click selection-action-trigger ${this.listContainerElement.dataset?.hasPermissionView == 'true' ? '' : 'hide'}" data-selection-action="select-all">
<input class="select-all-checkbox" type="checkbox">
<span class="disable-on-click"></span>
</label>
@ -121,7 +121,7 @@ class CorpusFileList extends ResourceList {
if (listItemElement === null) {return;}
let itemId = listItemElement.dataset.id;
let listActionElement = event.target.closest('.list-action-trigger[data-list-action]');
let listAction = listActionElement === null ? '' : listActionElement.dataset.listAction;
let listAction = listActionElement === null ? 'view' : listActionElement.dataset.listAction;
switch (listAction) {
case 'delete': {
let values = this.listjs.get('id', itemId)[0].values();

View File

@ -63,7 +63,7 @@ class CorpusList extends ResourceList {
get item() {
return (values) => {
return `
<tr class="list-item">
<tr class="list-item clickable hoverable">
<td>
<label class="list-action-trigger" data-list-action="select">
<input class="select-checkbox" type="checkbox">
@ -143,7 +143,7 @@ class CorpusList extends ResourceList {
if (listItemElement === null) {return;}
let itemId = listItemElement.dataset.id;
let listActionElement = event.target.closest('.list-action-trigger[data-list-action]');
let listAction = listActionElement === null ? '' : listActionElement.dataset.listAction;
let listAction = listActionElement === null ? 'view' : listActionElement.dataset.listAction;
switch (listAction) {
case 'delete-request': {
let values = this.listjs.get('id', itemId)[0].values();

View File

@ -56,7 +56,7 @@
<div class="col s12" id="user-corpora">
<div class="card">
<div class="card-content">
<div class="corpus-list no-autoinit" data-user-id="{{ user.hashid }}"></div>
<div class="corpus-list" data-user-id="{{ user.hashid }}"></div>
</div>
</div>
</div>
@ -107,16 +107,6 @@
{% block scripts %}
{{ super() }}
<script>
let corpusList = new CorpusList(document.querySelector('.corpus-list'));
corpusList.add(
[
{% for corpus in corpora %}
{{ corpus.to_json_serializeable(backrefs=True, relationships=True)|tojson }},
{% endfor %}
]
);
let userRoleChip = document.querySelector('#user-role-chip');
let userRoleChipTooltip = M.Tooltip.init(
userRoleChip,