Bug 38201: Get rid of e.preventDefault

Feels wrong to have datatable+event related args in BaseResource, remove that.
The only reason we needed preventDefault was because 'show' action was a
link with an href, but we dont even need that, and add 'role="button"'
for cursor:pointer mouseover interaction.

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Pedro Amorim 2024-07-11 15:02:46 +00:00 committed by Lucas Gass
parent 5e82ac70f1
commit b95a975d5a
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
2 changed files with 4 additions and 8 deletions

View File

@ -15,8 +15,7 @@ export default {
* @param {Object} resource - The resource to navigate to
* @return {void}
*/
goToResourceShow: function (resource, dt, event) {
event?.preventDefault();
goToResourceShow: function (resource) {
this.$router.push({
name: this.show_component,
params: { [this.id_attr]: resource[this.id_attr] },

View File

@ -140,6 +140,7 @@ export default {
},
actions: {
0: ["show"],
1: ["show"],
"-1": this.embedded
? [
{
@ -291,9 +292,7 @@ export default {
orderable: true,
render: function (data, type, row, meta) {
return (
'<a href="/cgi-bin/koha/erm/agreements/' +
row.agreement_id +
'" class="show">' +
'<a role="button" class="show">' +
escape_str(`${row.agreement_id}`) +
"</a>"
);
@ -306,9 +305,7 @@ export default {
orderable: true,
render: function (data, type, row, meta) {
return (
'<a href="/cgi-bin/koha/erm/agreements/' +
row.agreement_id +
'" class="show">' +
'<a role="button" class="show">' +
escape_str(row.name) +
"</a>"
);