Skip to content

Commit

Permalink
comments: Fix an incorrent DOM element selection.
Browse files Browse the repository at this point in the history
This commit fixes a bug that was causing text from previously edited
comment to get saved when two comments were edited one after other.
Text area with id of `#content` isn't unique on the page but it was
being treated as unique by the event handling code.

Fixes: go-gitea#5581.
  • Loading branch information
HarshitOnGitHub committed Dec 29, 2018
1 parent 945804f commit 428960d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion public/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ function initRepository() {
// Setup new form
if ($editContentZone.html().length == 0) {
$editContentZone.html($('#edit-content-form').html());
$textarea = $('#content');
$textarea = $editContentZone.find('textarea');
issuesTribute.attach($textarea.get());
emojiTribute.attach($textarea.get());

Expand Down

0 comments on commit 428960d

Please sign in to comment.