Skip to content

Commit 6852c47

Browse files
committed
move js call to the right place
1 parent 459a462 commit 6852c47

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

classes/post/post_control.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,7 @@ public function build_postform(array $pageparams): mod_moodleoverflow_post_form
680680
public function display_original_post(): string {
681681
global $PAGE, $DB;
682682
if ($this->interaction == 'reply') {
683+
$PAGE->requires->js_call_amd('mod_moodleoverflow/show_post', 'init');
683684
$post = post::from_record($DB->get_record('moodleoverflow_posts', ['id' => $this->info->relatedpost->get_id()]));
684685
$data = (object) [
685686
'postid' => $post->get_id(),

post.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@
167167
$PAGE->add_body_class('limitedwidth');
168168

169169
// Display all.
170-
$PAGE->requires->js_call_amd('mod_moodleoverflow/show_post', 'init');
171170
echo $OUTPUT->header();
172171
echo $postcontrol->display_original_post();
173172
$mformpost->display();

0 commit comments

Comments
 (0)