diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2017-07-03 19:23:28 +0300 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2017-07-06 09:30:07 +0300 |
commit | f1caa0b316c0be7c957e34a4bcc9f392023379d3 (patch) | |
tree | 622033b7d1a784a64407b9679fb093c764daea7f /app/assets/javascripts/oauth_remember_me.js | |
parent | 8fa08ea3cd81e906c4f4951c70e3571defeab7c7 (diff) |
Implement review comments for !11963 from @filipa.
- Disable an ESLint check rather than work around it (by
converting `OAuthRememberMe` from a regular class to a
static class.
- Scope `$` calls inside `OAuthRememberMe`
Diffstat (limited to 'app/assets/javascripts/oauth_remember_me.js')
-rw-r--r-- | app/assets/javascripts/oauth_remember_me.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/assets/javascripts/oauth_remember_me.js b/app/assets/javascripts/oauth_remember_me.js index 8f4796f2ede..ffc2dd6bbca 100644 --- a/app/assets/javascripts/oauth_remember_me.js +++ b/app/assets/javascripts/oauth_remember_me.js @@ -12,13 +12,14 @@ export default class OAuthRememberMe { } bindEvents() { - this.container.on('click', this.constructor.toggleRememberMe); + $('#remember_me', this.container).on('click', this.toggleRememberMe); } - static toggleRememberMe(event) { + // eslint-disable-next-line class-methods-use-this + toggleRememberMe(event) { const rememberMe = $(event.target).is(':checked'); - $('.oauth-login').each((i, element) => { + $('.oauth-login', this.container).each((i, element) => { const href = $(element).attr('href'); if (rememberMe) { |