Skip to content

Commit

Permalink
List support for tr.nolink class
Browse files Browse the repository at this point in the history
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
  • Loading branch information
daftspunk committed Jan 6, 2020
1 parent 06da92e commit 4a12951
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions modules/system/assets/ui/js/list.rowlink.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions modules/system/assets/ui/less/list.less
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion modules/system/assets/ui/less/list.rowlink.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// CSS for rowlink plugin
// ----------------------

tr.rowlink td {
tr.rowlink:not(.nolink) td {
cursor: pointer;
&.nolink {
cursor: auto;
Expand Down
4 changes: 2 additions & 2 deletions modules/system/assets/ui/storm-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions modules/system/assets/ui/storm.css
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 4a12951

Please sign in to comment.