Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
429932a8
Commit
429932a8
authored
Dec 09, 2015
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure new notes are highlighted properly on a merge request diff
parent
05f06955
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
app/assets/javascripts/notes.js.coffee
app/assets/javascripts/notes.js.coffee
+7
-3
No files found.
app/assets/javascripts/notes.js.coffee
View file @
429932a8
...
@@ -148,6 +148,8 @@ class @Notes
...
@@ -148,6 +148,8 @@ class @Notes
@
note_ids
.
push
(
note
.
id
)
@
note_ids
.
push
(
note
.
id
)
form
=
$
(
"form[rel='"
+
note
.
discussion_id
+
"']"
)
form
=
$
(
"form[rel='"
+
note
.
discussion_id
+
"']"
)
row
=
form
.
closest
(
"tr"
)
row
=
form
.
closest
(
"tr"
)
note_html
=
$
(
note
.
html
)
note_html
.
syntaxHighlight
()
# is this the first note of discussion?
# is this the first note of discussion?
if
row
.
is
(
".js-temp-notes-holder"
)
if
row
.
is
(
".js-temp-notes-holder"
)
...
@@ -158,14 +160,16 @@ class @Notes
...
@@ -158,14 +160,16 @@ class @Notes
row
.
next
().
find
(
".note"
).
remove
()
row
.
next
().
find
(
".note"
).
remove
()
# Add note to 'Changes' page discussions
# Add note to 'Changes' page discussions
$
(
".notes[rel='"
+
note
.
discussion_id
+
"']"
).
append
note
.
html
$
(
".notes[rel='"
+
note
.
discussion_id
+
"']"
).
append
note
_
html
# Init discussion on 'Discussion' page if it is merge request page
# Init discussion on 'Discussion' page if it is merge request page
if
$
(
'body'
).
attr
(
'data-page'
).
indexOf
(
'projects:merge_request'
)
==
0
if
$
(
'body'
).
attr
(
'data-page'
).
indexOf
(
'projects:merge_request'
)
==
0
$
(
'ul.main-notes-list'
).
append
(
note
.
discussion_with_diff_html
)
discussion_html
=
$
(
note
.
discussion_with_diff_html
)
discussion_html
.
syntaxHighlight
()
$
(
'ul.main-notes-list'
).
append
(
discussion_html
)
else
else
# append new note to all matching discussions
# append new note to all matching discussions
$
(
".notes[rel='"
+
note
.
discussion_id
+
"']"
).
append
note
.
html
$
(
".notes[rel='"
+
note
.
discussion_id
+
"']"
).
append
note
_
html
# cleanup after successfully creating a diff/discussion note
# cleanup after successfully creating a diff/discussion note
@
removeDiscussionNoteForm
(
form
)
@
removeDiscussionNoteForm
(
form
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment