Fix regression in challenge creation (#1638)

* Closes #1637
This commit is contained in:
Kevin Chung
2020-09-08 17:34:27 -04:00
committed by GitHub
parent efab97905b
commit cfde6c99af
3 changed files with 13 additions and 9 deletions

View File

@@ -425,13 +425,17 @@ $(() => {
$("#flags-create-select").change(flagTypeSelect);
$(".edit-flag").click(editFlagModal);
// Insert CommentBox element
const commentBox = Vue.extend(CommentBox);
let vueContainer = document.createElement("div");
document.querySelector("#comment-box").appendChild(vueContainer);
new commentBox({
propsData: { type: "challenge", id: window.CHALLENGE_ID }
}).$mount(vueContainer);
// Because this JS is shared by a few pages,
// we should only insert the CommentBox if it's actually in use
if (document.querySelector("#comment-box")) {
// Insert CommentBox element
const commentBox = Vue.extend(CommentBox);
let vueContainer = document.createElement("div");
document.querySelector("#comment-box").appendChild(vueContainer);
new commentBox({
propsData: { type: "challenge", id: window.CHALLENGE_ID }
}).$mount(vueContainer);
}
$.get(CTFd.config.urlRoot + "/api/v1/challenges/types", function(response) {
const data = response.data;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long