Skip to content

Commit 3b197de

Browse files
authored
Apply suggestions from code review
1 parent 367abe6 commit 3b197de

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

private/js/cms.editor.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -491,18 +491,16 @@ class CMSEditor {
491491

492492
if (script && script.textContent.length > 2) {
493493
this.CMS.API.Helpers.dataBridge = JSON.parse(script.textContent);
494-
console.log("CMS.API.Helpers.dataBridge", this.CMS.API.Helpers.dataBridge);
495494
} else {
496-
const regex1 = /^\s*Window\.CMS\.API\.Helpers\.dataBridge\s=\s(.*?);$/gmu.exec(body);
497-
const regex2 = /^\s*Window\.CMS\.API\.Helpers\.dataBridge\.structure\s=\s(.*?);$/gmu.exec(body);
495+
const regex1 = /^\s*Window\.CMS\.API\.Helpers\.dataBridge\s=\s(.*?);$/gmu.exec(dom.innerHTML);
496+
const regex2 = /^\s*Window\.CMS\.API\.Helpers\.dataBridge\.structure\s=\s(.*?);$/gmu.exec(dom.innerHTML);
498497

499498
if (regex1 && regex2 && this.CMS) {
500499
this.CMS.API.Helpers.dataBridge = JSON.parse(regex1[1]);
501500
this.CMS.API.Helpers.dataBridge.structure = JSON.parse(regex2[1]);
502-
console.log("CMS.API.Helpers.dataBridge by REGEX", this.CMS.API.Helpers.dataBridge);
503501
} else {
504502
// No databridge found
505-
this.CMS.API.Helpers.dataBridge = {};
503+
this.CMS.API.Helpers.dataBridge = null;
506504
}
507505
}
508506
// Additional content for the page disrupts inline editing and needs to be removed

0 commit comments

Comments
 (0)