aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Kuzminski <marcin@python-works.com>2012-12-14 03:31:44 +0100
committerMarcin Kuzminski <marcin@python-works.com>2012-12-14 03:31:44 +0100
commitd1152500adda2d0aa7f3446e2081840a3134fb02 (patch)
tree9a42dda66deae3f44bd7827b6dce5772253099eb
parentee3bfe8aa24275b51f1f8d394c7ca0a937d626f8 (diff)
remove reviewers button removes them without need of hitting save button.
--HG-- branch : beta
-rw-r--r--rhodecode/public/js/rhodecode.js9
-rw-r--r--rhodecode/templates/pullrequests/pullrequest_show.html11
2 files changed, 11 insertions, 9 deletions
diff --git a/rhodecode/public/js/rhodecode.js b/rhodecode/public/js/rhodecode.js
index 02e71555..5b1ddb2f 100644
--- a/rhodecode/public/js/rhodecode.js
+++ b/rhodecode/public/js/rhodecode.js
@@ -712,6 +712,14 @@ var deleteComment = function(comment_id){
}
var updateReviewers = function(reviewers_ids){
+ if (reviewers_ids === undefined){
+ var reviewers_ids = [];
+ var ids = YUQ('#review_members input');
+ for(var i=0; i<ids.length;i++){
+ var id = ids[i].value
+ reviewers_ids.push(id);
+ }
+ }
var url = AJAX_UPDATE_PULLREQUEST;
var postData = {'_method':'put',
'reviewers_ids': reviewers_ids};
@@ -852,6 +860,7 @@ var removeReviewer = function(reviewer_id){
if (el.parentNode !== undefined){
el.parentNode.removeChild(el);
}
+ updateReviewers();
}
var fileBrowserListeners = function(current_url, node_list_url, url_base){
diff --git a/rhodecode/templates/pullrequests/pullrequest_show.html b/rhodecode/templates/pullrequests/pullrequest_show.html
index cbadd0f0..2388b6dc 100644
--- a/rhodecode/templates/pullrequests/pullrequest_show.html
+++ b/rhodecode/templates/pullrequests/pullrequest_show.html
@@ -198,16 +198,9 @@
// inject comments into they proper positions
var file_comments = YUQ('.inline-comment-placeholder');
renderInlineComments(file_comments);
-
+
YUE.on(YUD.get('update_pull_request'),'click',function(e){
-
- var reviewers_ids = [];
- var ids = YUQ('#review_members input');
- for(var i=0; i<ids.length;i++){
- var id = ids[i].value
- reviewers_ids.push(id);
- }
- updateReviewers(reviewers_ids);
+ updateReviewers();
})
})
</script>