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
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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
21 deletions
+26
-21
merge_request.js
app/assets/javascripts/merge_request.js
+26
-0
_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 @@
...
@@ -27,6 +27,8 @@
// Prevent duplicate event bindings
// Prevent duplicate event bindings
this
.
disableTaskList
();
this
.
disableTaskList
();
this
.
initMRBtnListeners
();
this
.
initMRBtnListeners
();
this
.
initMessageWithDescriptionListener
();
this
.
initMessageWithoutDescriptionListener
();
if
(
$
(
"a.btn-close"
).
length
)
{
if
(
$
(
"a.btn-close"
).
length
)
{
this
.
initTaskList
();
this
.
initTaskList
();
}
}
...
@@ -108,6 +110,30 @@
...
@@ -108,6 +110,30 @@
// note so that we can re-use its form here
// 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
;
return
MergeRequest
;
})();
})();
...
...
app/views/shared/_commit_message_container.html.haml
View file @
e97c7100
...
@@ -22,24 +22,3 @@
...
@@ -22,24 +22,3 @@
%p
.hint.without-description-hint.hide
%p
.hint.without-description-hint.hide
=
link_to
"#"
,
class:
"without-description-link"
do
=
link_to
"#"
,
class:
"without-description-link"
do
Don't include description in commit message
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