Skip to content

Commit

Permalink
Merge pull request #199 from collective/frapell-match-all-classes
Browse files Browse the repository at this point in the history
Fix bug when pattern class is not the first one, after adding a new row
  • Loading branch information
petschki authored Nov 5, 2024
2 parents dfdf237 + 7b7534a commit 6c80901
Show file tree
Hide file tree
Showing 11 changed files with 1,364 additions and 1,536 deletions.
2 changes: 2 additions & 0 deletions news/198.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix bug when pattern class is not the first one, after adding a new row.
[frapell]
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"yarn": "^1.22.19"
},
"dependencies": {
"@patternslib/patternslib": "9.9.16",
"@plone/mockup": "5.1.13"
"@patternslib/patternslib": "^9.9.16",
"@plone/mockup": "^5.1.14"
},
"devDependencies": {
"@patternslib/dev": "^3.6.1"
Expand Down
9 changes: 5 additions & 4 deletions resources/js/datagridfield.pattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,12 @@ export default Base.extend({

var $new_row = $(new_row);
// enable patternslib
$new_row
.find('*[class^="dgw-disabled-pat-"]')
.attr("class", function (i, cls) {
return cls.replace(/dgw\-disabled-pat-/, "pat-");
const disabled_prefix = "dgw-disabled-pat-";
new_row.querySelectorAll(`[class*="${disabled_prefix}"]`).forEach(el => {
el.classList.forEach(cls => {
el.classList.replace(cls, cls.replace(disabled_prefix, "pat-"));
});
});
return new_row;
},

Expand Down

This file was deleted.

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

Large diffs are not rendered by default.

Loading

0 comments on commit 6c80901

Please sign in to comment.