Skip to content

Commit

Permalink
go from most to least specific delta names
Browse files Browse the repository at this point in the history
  • Loading branch information
i-just committed Apr 2, 2024
1 parent 6cd97c6 commit 32977ef
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/cp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/cp.js.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/web/assets/cp/src/js/Craft.js
Original file line number Diff line number Diff line change
Expand Up @@ -1205,6 +1205,9 @@ $.extend(Craft, {
grouped.__root__ = [];
}

// we have to reverse the order as need to go from most to least specific names
let reversedDeltaNames = deltaNames.reverse();

for (let name of deltaNames) {
grouped[name] = [];
}
Expand All @@ -1216,7 +1219,7 @@ $.extend(Craft, {

paramLoop: for (let param of params) {
// loop through the delta names from most -> least specific
for (let name of deltaNames) {
for (let name of reversedDeltaNames) {
const paramName = param.substring(0, name.length + 1);
if ([`${name}=`, `${name}[`].includes(paramName)) {
if (typeof grouped[name] === 'undefined') {
Expand Down

0 comments on commit 32977ef

Please sign in to comment.