diff options
author | Rubén Dávila <ruben@gitlab.com> | 2015-11-25 06:41:36 +0300 |
---|---|---|
committer | Rubén Dávila <ruben@gitlab.com> | 2015-12-04 18:43:33 +0300 |
commit | aa1ba0093632a66c9c9c0eac710d63d7513ad358 (patch) | |
tree | 9fe78dfa860f1607667bd9462ff46c58df914def /app/assets/javascripts/merge_request_widget.js.coffee | |
parent | 238ca3e472a67d319521daa5aeab6455b4740cdb (diff) |
Ensure "Remove Source Branch" button is not shown when branch is being deleted. #3583
Diffstat (limited to 'app/assets/javascripts/merge_request_widget.js.coffee')
-rw-r--r-- | app/assets/javascripts/merge_request_widget.js.coffee | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/app/assets/javascripts/merge_request_widget.js.coffee b/app/assets/javascripts/merge_request_widget.js.coffee index 3176e5a8965..c4b63966fe7 100644 --- a/app/assets/javascripts/merge_request_widget.js.coffee +++ b/app/assets/javascripts/merge_request_widget.js.coffee @@ -10,17 +10,20 @@ class @MergeRequestWidget constructor: (@opts) -> modal = $('#modal_merge_info').modal(show: false) - mergeInProgress: -> + mergeInProgress: (deleteSourceBranch = false)-> $.ajax type: 'GET' url: $('.merge-request').data('url') success: (data) => if data.state == "merged" - location.reload() + urlSuffix = if deleteSourceBranch then '?delete_source=true' else '' + + window.location.href = window.location.href + urlSuffix else if data.merge_error $('.mr-widget-body').html("<h4>" + data.merge_error + "</h4>") else - setTimeout(merge_request_widget.mergeInProgress, 2000) + callback = -> merge_request_widget.mergeInProgress(deleteSourceBranch) + setTimeout(callback, 2000) dataType: 'json' getMergeStatus: -> |