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
Kazuhiko Shiozaki
gitlab-ce
Commits
7c20f30f
Commit
7c20f30f
authored
Sep 25, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure notes are highlighted properly when they're updated
parent
9ade9a64
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
app/assets/javascripts/notes.js.coffee
app/assets/javascripts/notes.js.coffee
+9
-7
No files found.
app/assets/javascripts/notes.js.coffee
View file @
7c20f30f
...
@@ -277,13 +277,15 @@ class @Notes
...
@@ -277,13 +277,15 @@ class @Notes
Updates the current note field.
Updates the current note field.
###
###
updateNote
:
(
xhr
,
note
,
status
)
=>
updateNote
:
(
_xhr
,
note
,
_status
)
=>
note_li
=
$
(
".note-row-"
+
note
.
id
)
# Convert returned HTML to a jQuery object so we can modify it further
note_li
.
replaceWith
(
note
.
html
)
$html
=
$
(
note
.
html
)
note_li
.
find
(
'.note-edit-form'
).
hide
()
$html
.
syntaxHighlight
()
note_li
.
find
(
'.note-body > .note-text'
).
show
()
$html
.
find
(
'.js-task-list-container'
).
taskList
(
'enable'
)
note_li
.
find
(
'js-task-list-container'
).
taskList
(
'enable'
)
@
enableTaskList
()
# Find the note's `li` element by ID and replace it with the updated HTML
$note_li
=
$
(
"#note_
#{
note
.
id
}
"
)
$note_li
.
replaceWith
(
$html
)
###
###
Called in response to clicking the edit note link
Called in response to clicking the edit note link
...
...
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