不再使用 fire 和 watch 的方式通信

This commit is contained in:
virusdefender
2015-10-29 14:22:34 +08:00
parent f63685e3f7
commit 1cecb542d9

View File

@@ -52,10 +52,6 @@ require(["jquery", "avalon", "csrfToken", "bsAlert", "bootstrap"], function ($,
{ name: "首页", { name: "首页",
children: [{name: "主页", hash: "#index/index"}] children: [{name: "主页", hash: "#index/index"}]
}, },
{
name: "通用",
children: [{name: "公告管理", hash: "#announcement/announcement"}]
},
{ {
name: "比赛管理", name: "比赛管理",
children: [{name: "比赛列表", hash: "#contest/contest_list"}, children: [{name: "比赛列表", hash: "#contest/contest_list"},
@@ -75,9 +71,8 @@ require(["jquery", "avalon", "csrfToken", "bsAlert", "bootstrap"], function ($,
groupId: -1, groupId: -1,
problemId: -1, problemId: -1,
adminNavList: [], adminNavList: [],
$contestMode: -1,
$problemId: -1, contestId: -1,
$contestId: -1,
hide_loading: function () { hide_loading: function () {
$("#loading-gif").hide(); $("#loading-gif").hide();
}, },
@@ -113,24 +108,6 @@ require(["jquery", "avalon", "csrfToken", "bsAlert", "bootstrap"], function ($,
vm.template_url = "template/group/group.html"; vm.template_url = "template/group/group.html";
}); });
vm.$watch("showContestProblemPage", function (problemId, contestId, contestMode) {
vm.$problemId = problemId;
vm.$contestId = contestId;
vm.$contestMode = contestMode
vm.template_url = "template/contest/edit_problem.html";
});
vm.$watch("showContestListPage", function () {
vm.template_url = "template/contest/contest_list.html";
});
vm.$watch("showContestSubmissionPage", function (problemId, contestId, contestMode) {
vm.$problemId = problemId;
vm.$contestId = contestId;
vm.$contestMode = contestMode
vm.template_url = "template/contest/submission_list.html";
});
avalon.scan(); avalon.scan();
window.onhashchange = function () { window.onhashchange = function () {