From a0401dc079aaa74005f2154ba630341d4fe3df4f Mon Sep 17 00:00:00 2001 From: esp Date: Tue, 25 Aug 2015 10:58:14 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=89=8D=E7=AB=AF-BUG]=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=AF=94=E8=B5=9B=E7=BC=96=E8=BE=91=E5=8C=BA=E5=8F=AF=E8=A7=81?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF,(?= =?UTF-8?q?=E5=BF=98=E8=AE=B0=E5=8A=A0vm.),=E5=A2=9E=E5=8A=A0=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E6=88=90=E5=8A=9F=E9=9A=90=E8=97=8F=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=A1=86=E7=9A=84=E8=A1=8C=E4=B8=BA,=E6=9B=B4=E5=8A=A0?= =?UTF-8?q?=E6=96=B9=E4=BE=BF[CI=20SKIP]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/src/js/app/admin/contest/contest_list.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/static/src/js/app/admin/contest/contest_list.js b/static/src/js/app/admin/contest/contest_list.js index 30f8678b..f978f76c 100644 --- a/static/src/js/app/admin/contest/contest_list.js +++ b/static/src/js/app/admin/contest/contest_list.js @@ -21,6 +21,10 @@ require(["jquery", "avalon", "csrfToken", "bsAlert", "editor", "datetimePicker", bsAlert("你没有选择参赛用户!"); return false; } + if (vm.editDescription == "") { + bsAlert("比赛描述不能为空!"); + return false; + } if (vm.choseGroupList[0].id == 0) { //everyone | public contest if (vm.editPassword) { ajaxData.password = vm.editPassword; @@ -48,8 +52,8 @@ require(["jquery", "avalon", "csrfToken", "bsAlert", "editor", "datetimePicker", success: function (data) { if (!data.code) { bsAlert("修改成功!"); - console.log(data); - vm.getPage(1); + vm.editingContestId = 0; // Hide the editor + vm.getPage(1); // Refresh the contest list } else { bsAlert(data.data); @@ -148,7 +152,7 @@ require(["jquery", "avalon", "csrfToken", "bsAlert", "editor", "datetimePicker", vm.editStartTime = vm.contestList[contestId-1].start_time.substring(0,16).replace("T"," "); vm.editEndTime = vm.contestList[contestId-1].end_time.substring(0,16).replace("T"," "); vm.editMode = vm.contestList[contestId-1].mode; - editVisible = vm.contestList[contestId-1].visible; + vm.editVisible = vm.contestList[contestId-1].visible; if (vm.contestList[contestId-1].contest_type == 0) { //contest type == 0, contest in group //Clear the choseGroupList var stack = [], sp;