Commit fa7bb6e7 authored by Timothy Andrew's avatar Timothy Andrew

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`
parent 346db4ff
...@@ -135,7 +135,7 @@ import AuditLogs from './audit_logs'; ...@@ -135,7 +135,7 @@ import AuditLogs from './audit_logs';
case 'sessions:new': case 'sessions:new':
new UsernameValidator(); new UsernameValidator();
new ActiveTabMemoizer(); new ActiveTabMemoizer();
new OAuthRememberMe({ container: $("#remember_me") }).bindEvents(); new OAuthRememberMe({ container: $(".omniauth-container") }).bindEvents();
break; break;
case 'projects:boards:show': case 'projects:boards:show':
case 'projects:boards:index': case 'projects:boards:index':
......
...@@ -12,13 +12,14 @@ export default class OAuthRememberMe { ...@@ -12,13 +12,14 @@ export default class OAuthRememberMe {
} }
bindEvents() { 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'); const rememberMe = $(event.target).is(':checked');
$('.oauth-login').each((i, element) => { $('.oauth-login', this.container).each((i, element) => {
const href = $(element).attr('href'); const href = $(element).attr('href');
if (rememberMe) { if (rememberMe) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment