diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2017-07-03 16:23:28 +0000 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2017-07-03 16:25:10 +0000 |
commit | 60cb3e910a5781b6afeb4edcbda425d604581153 (patch) | |
tree | 622033b7d1a784a64407b9679fb093c764daea7f /app | |
parent | 4c34374d16411e728300be9f709bb3a7d10fbbde (diff) | |
download | gitlab-ce-60cb3e910a5781b6afeb4edcbda425d604581153.tar.gz |
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')
-rw-r--r-- | app/assets/javascripts/dispatcher.js | 2 | ||||
-rw-r--r-- | app/assets/javascripts/oauth_remember_me.js | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js index a58d1be68b5..e924fde60bf 100644 --- a/app/assets/javascripts/dispatcher.js +++ b/app/assets/javascripts/dispatcher.js @@ -128,7 +128,7 @@ import OAuthRememberMe from './oauth_remember_me'; case 'sessions:new': new UsernameValidator(); new ActiveTabMemoizer(); - new OAuthRememberMe({ container: $("#remember_me") }).bindEvents(); + new OAuthRememberMe({ container: $(".omniauth-container") }).bindEvents(); break; case 'projects:boards:show': case 'projects:boards:index': 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) { |