BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
ce29e5cd
Commit
ce29e5cd
authored
Apr 29, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update task list behavior for Merge Requests
parent
92249756
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
6 deletions
+27
-6
merge_request.js.coffee
app/assets/javascripts/merge_request.js.coffee
+23
-4
_context.html.haml
app/views/projects/merge_requests/show/_context.html.haml
+1
-1
_mr_box.html.haml
app/views/projects/merge_requests/show/_mr_box.html.haml
+3
-1
No files found.
app/assets/javascripts/merge_request.js.coffee
View file @
ce29e5cd
...
...
@@ -17,8 +17,11 @@ class @MergeRequest
disableButtonIfEmptyField
'#commit_message'
,
'.accept_merge_request'
# Prevent duplicate event bindings
@
disableTaskList
()
if
$
(
"a.btn-close"
).
length
$
(
"li.task-list-item input:checkbox"
).
prop
(
"disabled"
,
false
)
@
initTaskList
(
)
$
(
'.merge-request-details'
).
waitForImages
->
$
(
'.issuable-affix'
).
affix
offset
:
...
...
@@ -77,9 +80,6 @@ class @MergeRequest
this
.
$
(
'.remove_source_branch_in_progress'
).
hide
()
this
.
$
(
'.remove_source_branch_widget.failed'
).
show
()
$
(
'.task-list-item input:checkbox'
).
off
(
'change'
)
$
(
'.task-list-item input:checkbox'
).
change
(
'merge_request'
,
updateTaskState
)
activateTab
:
(
action
)
->
this
.
$
(
'.merge-request-tabs li'
).
removeClass
'active'
this
.
$
(
'.tab-content'
).
hide
()
...
...
@@ -156,3 +156,22 @@ class @MergeRequest
else
setTimeout
(
merge_request
.
mergeInProgress
,
3000
)
dataType
:
'json'
initTaskList
:
->
$
(
'.merge-request-details .js-task-list-container'
).
taskList
(
'enable'
)
$
(
document
).
on
'tasklist:changed'
,
'.merge-request-details .js-task-list-container'
,
@
updateTaskList
disableTaskList
:
->
$
(
'.merge-request-details .js-task-list-container'
).
taskList
(
'disable'
)
$
(
document
).
off
'tasklist:changed'
,
'.merge-request-details .js-task-list-container'
# TODO (rspeicher): Make the merge request description inline-editable like a
# note so that we can re-use its form here
updateTaskList
:
->
patchData
=
{}
patchData
[
'merge_request'
]
=
{
'description'
:
$
(
'.js-task-list-field'
,
this
).
val
()}
$
.
ajax
type
:
'PATCH'
url
:
$
(
'form.js-merge-request-update'
).
attr
(
'action'
)
data
:
patchData
app/views/projects/merge_requests/show/_context.html.haml
View file @
ce29e5cd
=
form_for
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
,
@merge_request
],
remote:
true
,
html:
{
class:
'edit-merge_request inline-update'
}
do
|
f
|
=
form_for
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
,
@merge_request
],
remote:
true
,
html:
{
class:
'edit-merge_request inline-update
js-merge-request-update
'
}
do
|
f
|
%div
.prepend-top-20
.issuable-context-title
%label
...
...
app/views/projects/merge_requests/show/_mr_box.html.haml
View file @
ce29e5cd
...
...
@@ -3,7 +3,9 @@
%div
-
if
@merge_request
.
description
.
present?
.description
.description
.js-task-list-container
.wiki
=
preserve
do
=
markdown
(
@merge_request
.
description
,
parse_tasks:
true
)
%textarea
.hidden.js-task-list-field
=
@merge_request
.
description
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