Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't add same line code comment box twice #11837

Merged
merged 3 commits into from
Jun 10, 2020

Conversation

silverwind
Copy link
Member

Clicking the same '+' button multiple times adds multiple comment boxes to the same line. Prevent this by assigning a unique key to each comment box and checking if it already exists in the DOM.

Also cleaned up the code around this a bit.

Clicking the same '+' button multiple times adds multiple comment boxes
to the same line. Prevent this by assigning a unique key to each comment
box and checking if it already exists in the DOM.

Also cleaned up the code around this a bit.
@techknowlogick techknowlogick added type/bug topic/ui Change the appearance of the Gitea UI labels Jun 10, 2020
@techknowlogick techknowlogick added this to the 1.13.0 milestone Jun 10, 2020
@GiteaBot GiteaBot added the lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. label Jun 10, 2020
web_src/js/index.js Outdated Show resolved Hide resolved
@techknowlogick techknowlogick merged commit a05a30c into go-gitea:master Jun 10, 2020
@silverwind silverwind deleted the one-comment-box branch June 10, 2020 22:17
ydelafollye pushed a commit to ydelafollye/gitea that referenced this pull request Jul 31, 2020
* Don't add same line code comment box twice

Clicking the same '+' button multiple times adds multiple comment boxes
to the same line. Prevent this by assigning a unique key to each comment
box and checking if it already exists in the DOM.

Also cleaned up the code around this a bit.

* Update web_src/js/index.js

Co-authored-by: Lauris BH <lauris@nix.lv>

Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/ui Change the appearance of the Gitea UI type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants