Commit 6fb1e80a authored by Stan Hu's avatar Stan Hu

Fix "Cannot move project" error message from popping up after a successful project transfer

Multiple event handlers were firing, causing multiple form submissions.

Closes #1448 and #1128
parent a66953b1
...@@ -3,7 +3,7 @@ Please view this file on the master branch, on stable branches it's out of date. ...@@ -3,7 +3,7 @@ Please view this file on the master branch, on stable branches it's out of date.
v 7.11.0 (unreleased) v 7.11.0 (unreleased)
- Fix clone URL field and X11 Primary selection (Dmitry Medvinsky) - Fix clone URL field and X11 Primary selection (Dmitry Medvinsky)
- Ignore invalid lines in .gitmodules - Ignore invalid lines in .gitmodules
- - Fix "Cannot move project" error message from popping up after a successful transfer (Stan Hu)
- -
- -
- -
......
...@@ -173,6 +173,7 @@ $ -> ...@@ -173,6 +173,7 @@ $ ->
$(@).closest(".diff-file").find(".notes_holder").toggle() $(@).closest(".diff-file").find(".notes_holder").toggle()
e.preventDefault() e.preventDefault()
$(document).off "click", '.js-confirm-danger'
$(document).on "click", '.js-confirm-danger', (e) -> $(document).on "click", '.js-confirm-danger', (e) ->
e.preventDefault() e.preventDefault()
btn = $(e.target) btn = $(e.target)
......
...@@ -8,11 +8,13 @@ class @ConfirmDangerModal ...@@ -8,11 +8,13 @@ class @ConfirmDangerModal
submit = $('.js-confirm-danger-submit') submit = $('.js-confirm-danger-submit')
submit.disable() submit.disable()
$('.js-confirm-danger-input').off 'input'
$('.js-confirm-danger-input').on 'input', -> $('.js-confirm-danger-input').on 'input', ->
if rstrip($(@).val()) is project_path if rstrip($(@).val()) is project_path
submit.enable() submit.enable()
else else
submit.disable() submit.disable()
$('.js-confirm-danger-submit').off 'click'
$('.js-confirm-danger-submit').on 'click', => $('.js-confirm-danger-submit').on 'click', =>
@form.submit() @form.submit()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment