Skip to content
Snippets Groups Projects
Commit f1caa0b3 authored by Timothy Andrew's avatar Timothy Andrew
Browse files

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 8fa08ea3
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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':
Loading
Loading
Loading
Loading
@@ -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) {
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment