Skip to content

Commit 3cd50b9

Browse files
authored
JI-3620 Refactor use of glorified loop
The editor widgets relies on references to the parameter objects, changing the parameter object without updating the references means that the editor widgets will continue updating objects that won't be saved.
1 parent ca5cc43 commit 3cd50b9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/h5peditor-form.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,9 @@ ns.Form.prototype.setSubContentDefaultLanguage = function (params, lang) {
351351
const self = this;
352352

353353
if (Array.isArray(params)) {
354-
params = params.map(function (listItem) {
355-
return self.setSubContentDefaultLanguage(listItem, lang);
356-
});
354+
for (let i; i < params.length; i++) {
355+
params[i] = self.setSubContentDefaultLanguage(params[i], lang);
356+
}
357357
}
358358
else if (typeof params === 'object') {
359359
if (params.metadata) {

0 commit comments

Comments
 (0)