summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/issuable_index.js
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-01-30 10:57:00 +0000
committerPhil Hughes <me@iamphill.com>2018-01-30 10:57:00 +0000
commitdc996051142c2888d69d97e58e17ce5a009937c6 (patch)
tree00458d0c07fb0c2edccaae3efa873d29012c1580 /app/assets/javascripts/issuable_index.js
parent2b66879ea2ae8ac3ae7015eb2b083770f973ad4e (diff)
downloadgitlab-ce-dc996051142c2888d69d97e58e17ce5a009937c6.tar.gz
cache jQuery selectorph-ajax-into-axios
Diffstat (limited to 'app/assets/javascripts/issuable_index.js')
-rw-r--r--app/assets/javascripts/issuable_index.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/app/assets/javascripts/issuable_index.js b/app/assets/javascripts/issuable_index.js
index aafadcb7d4e..0683ca82a38 100644
--- a/app/assets/javascripts/issuable_index.js
+++ b/app/assets/javascripts/issuable_index.js
@@ -23,21 +23,23 @@ export default class IssuableIndex {
}
static resetIncomingEmailToken() {
- $('.incoming-email-token-reset').on('click', (e) => {
+ const $resetToken = $('.incoming-email-token-reset');
+
+ $resetToken.on('click', (e) => {
e.preventDefault();
- $('.incoming-email-token-reset').text('resetting...');
+ $resetToken.text('resetting...');
- axios.put($('.incoming-email-token-reset').attr('href'))
+ axios.put($resetToken.attr('href'))
.then(({ data }) => {
$('#issuable_email').val(data.new_address).focus();
- $('.incoming-email-token-reset').text('reset it');
+ $resetToken.text('reset it');
})
.catch(() => {
flash(__('There was an error when reseting email token.'));
- $('.incoming-email-token-reset').text('reset it');
+ $resetToken.text('reset it');
});
});
}