| @@ -50,9 +50,12 @@ | ||
| 50 | 50 | echo 'win.visualizer.charts.canvas.data = ', $this->data, ';'; |
| 51 | 51 | if ( $this->settings ) { |
| 52 | 52 | echo 'win.visualizer.charts.canvas.settings = ', $this->settings, ';'; |
| 53 | 53 | } |
| 54 | - echo 'win.visualizer.update();'; | |
| 54 | + echo 'win.updateChartPreview();'; | |
| 55 | + | |
| 56 | + echo $this->updateEditorAndSettings(); | |
| 57 | + | |
| 55 | 58 | echo '}'; |
| 56 | 59 | |
| 57 | 60 | do_action( 'visualizer_add_update_hook', $this->series, $this->data ); |
| 58 | 61 | |
| @@ -67,7 +70,24 @@ | ||
| 67 | 70 | echo '</script>'; |
| 68 | 71 | echo '</head>'; |
| 69 | 72 | echo '<body></body>'; |
| 70 | 73 | echo '</html>'; |
| 74 | + } | |
| 75 | + | |
| 76 | + | |
| 77 | + /** | |
| 78 | + * Update the hidden content in the LHS and the advanced settings | |
| 79 | + */ | |
| 80 | + private function updateEditorAndSettings() { | |
| 81 | + $editor = ''; | |
| 82 | + if ( Visualizer_Module::can_show_feature( 'simple-editor' ) ) { | |
| 83 | + ob_start(); | |
| 84 | + Visualizer_Render_Layout::show( 'simple-editor-screen', $this->id ); | |
| 85 | + $editor = ob_get_clean(); | |
| 86 | + } | |
| 87 | + | |
| 88 | + $sidebar = apply_filters( 'visualizer_get_sidebar', '', $this->id ); | |
| 89 | + | |
| 90 | + return 'win.updateHTML(' . json_encode( array( 'html' => $editor ) ) . ', ' . json_encode( array( 'html' => $sidebar ) ) . ');'; | |
| 71 | 91 | } |
| 72 | 92 | |
| 73 | 93 | } |