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 bug when pattern class is not the first one, after adding a new row #199

Merged
merged 7 commits into from
Nov 5, 2024
Merged
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: 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
Loading