提交 f1caa0b3 编写于 作者: T 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`
上级 8fa08ea3
......@@ -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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册