Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX Add one to current colspan in fixColumns instead of resetting to 2 #1869

Open
wants to merge 1 commit into
base: 2.3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion client/src/legacy/GridField.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import '../../../thirdparty/jquery-entwine/jquery.entwine.js';
$.entwine('ss', function($) {
$('.grid-field').entwine({
onmatch: function () {
// Adds an actions column for the search action if it does not exist already
if (this.needsColumnFix()) {
this.fixColumns();
this.injectSearchButton(false);
Expand Down Expand Up @@ -175,8 +176,10 @@ $.entwine('ss', function($) {
fixColumns: function (visible) {
this.find('.sortable-header').append('<th class="main col-Actions" />');
this.find('tbody tr').each(function () {
// Note we need to add 1 to the current column span, because we're going to add a new column
var cell = $(this).find('td:last');
cell.attr('colspan', 2);
var colspan = cell.attr('colspan') ?? 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var colspan = cell.attr('colspan') ?? 1;
// Note we need to add 1 to the current column span, because we're going to add a new column
var colspan = cell.attr('colspan') ?? 1;

cell.attr('colspan', colspan + 1);
GuySartorelli marked this conversation as resolved.
Show resolved Hide resolved
});
var $extraCell = $('<th class="extra" />');
$('.grid-field__filter-header th:last .action').each(function() {
Expand Down