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
Boxiang Sun
gitlab-ce
Commits
92249756
Commit
92249756
authored
Apr 29, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update task list behavior for Notes
parent
a3d55db9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
4 deletions
+20
-4
app/assets/javascripts/notes.js.coffee
app/assets/javascripts/notes.js.coffee
+17
-0
app/views/projects/notes/_edit_form.html.haml
app/views/projects/notes/_edit_form.html.haml
+2
-3
app/views/projects/notes/_note.html.haml
app/views/projects/notes/_note.html.haml
+1
-1
No files found.
app/assets/javascripts/notes.js.coffee
View file @
92249756
...
...
@@ -11,6 +11,7 @@ class @Notes
@
setupMainTargetNoteForm
()
@
cleanBinding
()
@
addBinding
()
@
initTaskList
()
addBinding
:
->
# add note to UI after creation
...
...
@@ -81,6 +82,9 @@ class @Notes
$
(
document
).
off
"click"
,
".js-note-target-reopen"
$
(
document
).
off
"click"
,
".js-note-target-close"
$
(
'.note .js-task-list-container'
).
taskList
(
'disable'
)
$
(
document
).
off
'tasklist:changed'
,
'.note .js-task-list-container'
initRefresh
:
->
clearInterval
(
Notes
.
interval
)
Notes
.
interval
=
setInterval
=>
...
...
@@ -114,6 +118,7 @@ class @Notes
if
@
isNewNote
(
note
)
@
note_ids
.
push
(
note
.
id
)
$
(
'ul.main-notes-list'
).
append
(
note
.
html
)
@
initTaskList
()
###
Check if note does not exists on page
...
...
@@ -268,6 +273,8 @@ class @Notes
note_li
.
replaceWith
(
note
.
html
)
note_li
.
find
(
'.note-edit-form'
).
hide
()
note_li
.
find
(
'.note-body > .note-text'
).
show
()
note_li
.
find
(
'js-task-list-container'
).
taskList
(
'enable'
)
@
enableTaskList
()
###
Called in response to clicking the edit note link
...
...
@@ -479,3 +486,13 @@ class @Notes
else
form
.
find
(
'.js-note-target-reopen'
).
text
(
'Reopen'
)
form
.
find
(
'.js-note-target-close'
).
text
(
'Close'
)
enableTaskList
:
->
$
(
'.note .js-task-list-container'
).
taskList
(
'enable'
)
initTaskList
:
->
@
enableTaskList
()
$
(
document
).
on
'tasklist:changed'
,
'.note .js-task-list-container'
,
@
updateTaskList
updateTaskList
:
->
$
(
'form'
,
this
).
submit
()
app/views/projects/notes/_edit_form.html.haml
View file @
92249756
.note-edit-form
=
form_for
note
,
url:
namespace_project_note_path
(
@project
.
namespace
,
@project
,
note
),
method: :put
,
remote:
true
,
authenticity_token:
true
do
|
f
|
=
note_target_fields
(
note
)
=
render
layout:
'projects/md_preview'
,
locals:
{
preview_class:
"note-text"
}
do
=
render
'projects/zen'
,
f:
f
,
attr: :note
,
classes:
'note_text js-note-text'
=
render
layout:
'projects/md_preview'
,
locals:
{
preview_class:
'note-text'
}
do
=
render
'projects/zen'
,
f:
f
,
attr: :note
,
classes:
'note_text js-note-text js-task-list-field'
.comment-hints.clearfix
.pull-left
Comments are parsed with
#{
link_to
"GitLab Flavored Markdown"
,
help_page_path
(
"markdown"
,
"markdown"
),{
target:
'_blank'
,
tabindex:
-
1
}
}
...
...
app/views/projects/notes/_note.html.haml
View file @
92249756
...
...
@@ -50,7 +50,7 @@
\-1
.note-body
.note-body
.js-task-list-container
.note-text
=
preserve
do
=
markdown
(
note
.
note
,
{
no_header_anchors:
true
})
...
...
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