修复编辑问题页面样例混乱的问题,加载新问题不会删除上一次编辑问题的老样例[CI SKIP]

This commit is contained in:
sxw 2015-11-02 19:08:10 +08:00
parent edaad01253
commit 6b263db3ba

View File

@ -147,7 +147,7 @@ require(["jquery", "avalon", "editor", "uploader", "bsAlert", "csrfToken", "tagE
} }
}, },
function (file, percentage) { function (file, percentage) {
vm.uploadProgress = percentage; vm.uploadProgress = parseInt(percentage * 100);
} }
); );
@ -165,6 +165,7 @@ require(["jquery", "avalon", "editor", "uploader", "bsAlert", "csrfToken", "tagE
avalon.vmodels.problemDescriptionEditor.content = problem.description; avalon.vmodels.problemDescriptionEditor.content = problem.description;
vm.timeLimit = problem.time_limit; vm.timeLimit = problem.time_limit;
vm.memoryLimit = problem.memory_limit; vm.memoryLimit = problem.memory_limit;
vm.samples = [];
for (var i = 0; i < problem.samples.length; i++) { for (var i = 0; i < problem.samples.length; i++) {
vm.samples.push({ vm.samples.push({
input: problem.samples[i].input, input: problem.samples[i].input,