Skip to content

Commit 6ac2217

Browse files
authored
Merge pull request #2 from germanbisurgi/master
Explicitly push the son-editor instance into the window global object
2 parents 30d40cd + 629eaae commit 6ac2217

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/JsonEditorWidget.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public function run()
140140
// Add the "JSONEditor" instance to the global window object, otherwise the instance is only available in "ready()" function scope
141141
$widgetJs = "window.{$widgetId} = new JSONEditor(document.getElementById('{$containerId}'), {$clientOptions});\n";
142142
// Add the "JSONEditor" instance to the global window.jsonEditors array.
143-
$widgetJs .= "if (!window.jsonEditors) { window.jsonEditors = []; } window.jsonEditors.push({$widgetId});";
143+
$widgetJs .= "if (!window.jsonEditors) { window.jsonEditors = []; } window.jsonEditors.push(window.{$widgetId});";
144144

145145
$readyFunction = '';
146146
try {

0 commit comments

Comments
 (0)