Commit 60cb3e91 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 4c34374d
......@@ -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':
......
......@@ -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) {
......
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