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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
14a932f1
Commit
14a932f1
authored
Sep 15, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix context for jquery event
Remove unused function
parent
6a8faac2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
app/assets/javascripts/lib/utils/common_utils.js
app/assets/javascripts/lib/utils/common_utils.js
+5
-7
No files found.
app/assets/javascripts/lib/utils/common_utils.js
View file @
14a932f1
...
@@ -34,12 +34,12 @@ export const isInIssuePage = () => {
...
@@ -34,12 +34,12 @@ export const isInIssuePage = () => {
};
};
window
.
gl
.
utils
.
isInIssuePage
=
isInGroupsPage
;
window
.
gl
.
utils
.
isInIssuePage
=
isInGroupsPage
;
window
.
gl
.
utils
.
ajaxGet
=
url
=>
$
.
ajax
({
export
const
ajaxGet
=
url
=>
$
.
ajax
({
type
:
'
GET
'
,
type
:
'
GET
'
,
url
,
url
,
dataType
:
'
script
'
,
dataType
:
'
script
'
,
});
});
export
const
ajaxGet
=
window
.
gl
.
utils
.
ajaxGet
;
window
.
gl
.
utils
.
ajaxGet
=
ajaxGet
;
export
const
ajaxPost
=
(
url
,
data
)
=>
$
.
ajax
({
export
const
ajaxPost
=
(
url
,
data
)
=>
$
.
ajax
({
type
:
'
POST
'
,
type
:
'
POST
'
,
...
@@ -48,10 +48,7 @@ export const ajaxPost = (url, data) => $.ajax({
...
@@ -48,10 +48,7 @@ export const ajaxPost = (url, data) => $.ajax({
});
});
window
.
gl
.
utils
.
ajaxPost
=
ajaxPost
;
window
.
gl
.
utils
.
ajaxPost
=
ajaxPost
;
// TODO: This function seems not to be used anywhere
export
const
rstrip
=
(
val
)
=>
{
// window.gl.utils.extractLast = term => this.split(term).pop();
export
const
rstrip
=
function
rstrip
(
val
)
{
if
(
val
)
{
if
(
val
)
{
return
val
.
replace
(
/
\s
+$/
,
''
);
return
val
.
replace
(
/
\s
+$/
,
''
);
}
}
...
@@ -68,7 +65,8 @@ export const disableButtonIfEmptyField = (fieldSelector, buttonSelector, eventNa
...
@@ -68,7 +65,8 @@ export const disableButtonIfEmptyField = (fieldSelector, buttonSelector, eventNa
if
(
rstrip
(
field
.
val
())
===
''
)
{
if
(
rstrip
(
field
.
val
())
===
''
)
{
closestSubmit
.
disable
();
closestSubmit
.
disable
();
}
}
return
field
.
on
(
eventName
,
()
=>
{
// eslint-disable-next-line func-names
return
field
.
on
(
eventName
,
function
()
{
if
(
rstrip
(
$
(
this
).
val
())
===
''
)
{
if
(
rstrip
(
$
(
this
).
val
())
===
''
)
{
return
closestSubmit
.
disable
();
return
closestSubmit
.
disable
();
}
}
...
...
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