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
e97c7100
Commit
e97c7100
authored
Nov 28, 2016
by
Gabriel Gizotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move javascript code from _commit_message_container view to javascripts/merge_request.js
parent
58609f84
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
21 deletions
+26
-21
app/assets/javascripts/merge_request.js
app/assets/javascripts/merge_request.js
+26
-0
app/views/shared/_commit_message_container.html.haml
app/views/shared/_commit_message_container.html.haml
+0
-21
No files found.
app/assets/javascripts/merge_request.js
View file @
e97c7100
...
...
@@ -27,6 +27,8 @@
// Prevent duplicate event bindings
this
.
disableTaskList
();
this
.
initMRBtnListeners
();
this
.
initMessageWithDescriptionListener
();
this
.
initMessageWithoutDescriptionListener
();
if
(
$
(
"
a.btn-close
"
).
length
)
{
this
.
initTaskList
();
}
...
...
@@ -108,6 +110,30 @@
// note so that we can re-use its form here
};
MergeRequest
.
prototype
.
initMessageWithDescriptionListener
=
function
()
{
return
$
(
'
a.with-description-link
'
).
on
(
'
click
'
,
function
(
e
)
{
e
.
preventDefault
();
var
textarea
=
$
(
'
textarea.js-commit-message
'
);
textarea
.
val
(
textarea
.
data
(
'
messageWithDescription
'
));
$
(
'
p.with-description-hint
'
).
hide
();
$
(
'
p.without-description-hint
'
).
show
();
});
};
MergeRequest
.
prototype
.
initMessageWithoutDescriptionListener
=
function
()
{
return
$
(
'
a.without-description-link
'
).
on
(
'
click
'
,
function
(
e
)
{
e
.
preventDefault
();
var
textarea
=
$
(
'
textarea.js-commit-message
'
);
textarea
.
val
(
textarea
.
data
(
'
messageWithoutDescription
'
));
$
(
'
p.with-description-hint
'
).
show
();
$
(
'
p.without-description-hint
'
).
hide
();
});
};
return
MergeRequest
;
})();
...
...
app/views/shared/_commit_message_container.html.haml
View file @
e97c7100
...
...
@@ -22,24 +22,3 @@
%p
.hint.without-description-hint.hide
=
link_to
"#"
,
class:
"without-description-link"
do
Don't include description in commit message
:javascript
$
(
'
.with-description-link
'
).
on
(
'
click
'
,
function
(
e
)
{
e
.
preventDefault
();
var
textarea
=
$
(
'
.js-commit-message
'
)
textarea
.
val
(
textarea
.
data
(
'
messageWithDescription
'
))
$
(
'
.with-description-hint
'
).
hide
();
$
(
'
.without-description-hint
'
).
show
();
});
$
(
'
.without-description-link
'
).
on
(
'
click
'
,
function
(
e
)
{
e
.
preventDefault
();
var
textarea
=
$
(
'
.js-commit-message
'
)
textarea
.
val
(
textarea
.
data
(
'
messageWithoutDescription
'
))
$
(
'
.with-description-hint
'
).
show
();
$
(
'
.without-description-hint
'
).
hide
();
});
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