From d861b70603bf4add997eb9b2d3694cb7d009c043 Mon Sep 17 00:00:00 2001 From: Kevin Chung Date: Thu, 28 Dec 2017 04:09:42 -0500 Subject: [PATCH] Fixing page previews --- CTFd/themes/admin/templates/editor.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CTFd/themes/admin/templates/editor.html b/CTFd/themes/admin/templates/editor.html index ca4d3df6..4f5124bb 100644 --- a/CTFd/themes/admin/templates/editor.html +++ b/CTFd/themes/admin/templates/editor.html @@ -335,14 +335,14 @@ }); } - $(document).ready(function () { - function preview_page() { - editor.save(); // Save the CodeMirror data to the Textarea - $('#page-edit').attr('action', '{{ request.script_root }}/admin/pages?operation=preview'); - $('#page-edit').attr('target', '_blank'); - $('#page-edit').submit(); - } + function preview_page() { + editor.save(); // Save the CodeMirror data to the Textarea + $('#page-edit').attr('action', '{{ request.script_root }}/admin/pages?operation=preview'); + $('#page-edit').attr('target', '_blank'); + $('#page-edit').submit(); + } + $(document).ready(function () { $('#media-insert').click(function (e) { var tag = $('#media-icon').children()[0].nodeName.toLowerCase(); console.log(tag);