List support for tr.nolink class

The `nolink` CSS class can now be applied to table rows elements (TR) in addition to table data elements (TD) to disable the click event
This commit is contained in:
Samuel Georges 2020-01-06 19:44:06 +11:00
parent 06da92e06d
commit 4a1295162c
5 changed files with 14 additions and 14 deletions

View File

@ -62,11 +62,11 @@
}
}
$(this).find('td').not('.' + options.excludeClass).click(function(e) {
$(this).not('.' + options.excludeClass).find('td').not('.' + options.excludeClass).click(function(e) {
handleClick(e)
})
$(this).on('keypress', function(e) {
$(this).not('.' + options.excludeClass).on('keypress', function(e) {
if (e.key === '(Space character)' || e.key === 'Spacebar' || e.key === ' ') {
handleClick(e)
return false

View File

@ -153,7 +153,7 @@ table.table.data {
}
}
tr.rowlink:hover td, tr:not(.no-data).selected td {
tr.rowlink:not(.nolink):hover td, tr:not(.no-data).selected td {
background: @color-list-hover-bg !important;
color: @highlight-hover-text;
@ -162,7 +162,7 @@ table.table.data {
}
}
tr.rowlink:active td {
tr.rowlink:not(.nolink):active td {
background: @color-list-active-bg !important;
color: @color-list-active-text;
}

View File

@ -2,7 +2,7 @@
// CSS for rowlink plugin
// ----------------------
tr.rowlink td {
tr.rowlink:not(.nolink) td {
cursor: pointer;
&.nolink {
cursor: auto;

View File

@ -4073,8 +4073,8 @@ else if(request){link.request()}
else if(popup){link.popup()}
else if(e.ctrlKey||e.metaKey){window.open(href)}
else{window.location=href}}
$(this).find('td').not('.'+options.excludeClass).click(function(e){handleClick(e)})
$(this).on('keypress',function(e){if(e.key==='(Space character)'||e.key==='Spacebar'||e.key===' '){handleClick(e)
$(this).not('.'+options.excludeClass).find('td').not('.'+options.excludeClass).click(function(e){handleClick(e)})
$(this).not('.'+options.excludeClass).on('keypress',function(e){if(e.key==='(Space character)'||e.key==='Spacebar'||e.key===' '){handleClick(e)
return false}})
$(this).addClass(options.linkedClass)
link.hide().after(link.html())})

View File

@ -4288,8 +4288,8 @@ body.slim-container .form-buttons {padding:0 20px 20px}
[data-control=toolbar] .select2-container .select2-selection__rendered {line-height:17px}
[data-control=toolbar] .select2-container .select2-selection--single {height:36px}
[data-control=toolbar] select.form-control.custom-select {display:none}
tr.rowlink td {cursor:pointer}
tr.rowlink td.nolink {cursor:auto}
tr.rowlink:not(.nolink) td {cursor:pointer}
tr.rowlink:not(.nolink) td.nolink {cursor:auto}
.table tbody tr.rowlink:hover td {background-color:#f5f5f5}
a.rowlink {color:inherit;font:inherit;text-decoration:inherit}
table {max-width:100%;background-color:transparent}
@ -4472,15 +4472,15 @@ table.table.data tbody tr:last-child td {border-bottom-width:0}
table.table.data tbody tr td:first-child {border-left:3px solid transparent;padding-left:22px}
table.table.data tbody tr.active td {color:#000}
table.table.data tbody tr.active td:first-child {border-left:3px solid #f93}
table.table.data tbody tr.rowlink:hover td,
table.table.data tbody tr.rowlink:not(.nolink):hover td,
table.table.data tbody tr:not(.no-data).selected td {background:#4ea5e0 !important;color:#fff}
table.table.data tbody tr.rowlink:hover td a:not(.btn),
table.table.data tbody tr.rowlink:not(.nolink):hover td a:not(.btn),
table.table.data tbody tr:not(.no-data).selected td a:not(.btn),
table.table.data tbody tr.rowlink:hover td span,
table.table.data tbody tr.rowlink:not(.nolink):hover td span,
table.table.data tbody tr:not(.no-data).selected td span,
table.table.data tbody tr.rowlink:hover td i[class^="icon-"],
table.table.data tbody tr.rowlink:not(.nolink):hover td i[class^="icon-"],
table.table.data tbody tr:not(.no-data).selected td i[class^="icon-"] {color:#fff}
table.table.data tbody tr.rowlink:active td {background:#3498db !important;color:#fff}
table.table.data tbody tr.rowlink:not(.nolink):active td {background:#3498db !important;color:#fff}
table.table.data tbody tr.hidden td,
table.table.data tbody tr.hidden th,
table.table.data tbody tr.hidden td a,