summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/assets/javascripts/dispatcher.js2
-rw-r--r--app/assets/javascripts/oauth_remember_me.js7
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) {