diff options
author | FuXiaoHei <fuxiaohei@hexiaz.com> | 2014-05-24 13:39:12 +0800 |
---|---|---|
committer | FuXiaoHei <fuxiaohei@hexiaz.com> | 2014-05-24 13:39:12 +0800 |
commit | 50ba08e2c602993fc283b2d868639820aba57528 (patch) | |
tree | a3c466a0661074bd472824c84cfeaa4e0fcb9c8c /public/js | |
parent | 5e9a45f74a7f55cde71054255bd8dec8a8037a72 (diff) | |
download | gitea-50ba08e2c602993fc283b2d868639820aba57528.tar.gz gitea-50ba08e2c602993fc283b2d868639820aba57528.zip |
fix issue label ajax
Diffstat (limited to 'public/js')
-rw-r--r-- | public/js/app.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/public/js/app.js b/public/js/app.js index 67b5a5dfc7..419b8d82e8 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -620,6 +620,7 @@ function initIssue() { }); // labels + var removeLabels = []; $('#label-manage-btn').on("click", function () { var $list = $('#label-list'); if ($list.hasClass("managing")) { @@ -630,7 +631,7 @@ function initIssue() { ids.push(id); } }); - $.post($list.data("ajax"), {"ids": ids.join(",")}, function (json) { + $.post($list.data("ajax"), {"ids": ids.join(","), "remove": removeLabels.join(",")}, function (json) { if (json.ok) { window.location.reload(); } @@ -653,14 +654,16 @@ function initIssue() { } }); $("#label-list").on('click', '.del', function () { - $(this).parent().remove(); + var $p = $(this).parent(); + removeLabels.push($p.data('id')); + $p.remove(); return false; }); $('.issue-bar .labels .dropdown-menu').on('click', 'li', function (e) { var url = $('.issue-bar .labels').data("ajax"); var id = $(this).data('id'); var check = $(this).hasClass("checked"); - $.post(url, {id: id, action: check ? 'detach' : "attach"}, function (json) { + $.post(url, {id: id, action: check ? 'detach' : "attach", issue: $('#issue').data('id')}, function (json) { if (json.ok) { window.location.reload(); } |