summaryrefslogtreecommitdiff
path: root/app/assets/javascripts
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-09-15 14:24:46 +0100
committerFilipa Lacerda <filipa@gitlab.com>2017-09-15 14:24:46 +0100
commit14a932f18094c2826cf958ff110075e32c18d684 (patch)
tree89d2481ab8397229cae0838a4dcccff6a6f3760d /app/assets/javascripts
parent6a8faac28ae7a730cfe3a13fad347f4e55cec505 (diff)
downloadgitlab-ce-14a932f18094c2826cf958ff110075e32c18d684.tar.gz
Fix context for jquery event
Remove unused function
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/lib/utils/common_utils.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/app/assets/javascripts/lib/utils/common_utils.js b/app/assets/javascripts/lib/utils/common_utils.js
index 76e436ceab5..b65758015d5 100644
--- a/app/assets/javascripts/lib/utils/common_utils.js
+++ b/app/assets/javascripts/lib/utils/common_utils.js
@@ -34,12 +34,12 @@ export const isInIssuePage = () => {
};
window.gl.utils.isInIssuePage = isInGroupsPage;
-window.gl.utils.ajaxGet = url => $.ajax({
+export const ajaxGet = url => $.ajax({
type: 'GET',
url,
dataType: 'script',
});
-export const ajaxGet = window.gl.utils.ajaxGet;
+window.gl.utils.ajaxGet = ajaxGet;
export const ajaxPost = (url, data) => $.ajax({
type: 'POST',
@@ -48,10 +48,7 @@ export const ajaxPost = (url, data) => $.ajax({
});
window.gl.utils.ajaxPost = ajaxPost;
-// TODO: This function seems not to be used anywhere
-// window.gl.utils.extractLast = term => this.split(term).pop();
-
-export const rstrip = function rstrip(val) {
+export const rstrip = (val) => {
if (val) {
return val.replace(/\s+$/, '');
}
@@ -68,7 +65,8 @@ export const disableButtonIfEmptyField = (fieldSelector, buttonSelector, eventNa
if (rstrip(field.val()) === '') {
closestSubmit.disable();
}
- return field.on(eventName, () => {
+ // eslint-disable-next-line func-names
+ return field.on(eventName, function () {
if (rstrip($(this).val()) === '') {
return closestSubmit.disable();
}