diff --git a/app/assets/javascripts/discourse/routes/application.js.es6 b/app/assets/javascripts/discourse/routes/application.js.es6 index 3ba76b64902..45dbfbf77c3 100644 --- a/app/assets/javascripts/discourse/routes/application.js.es6 +++ b/app/assets/javascripts/discourse/routes/application.js.es6 @@ -157,20 +157,21 @@ const ApplicationRoute = Discourse.Route.extend({ const returnPath = encodeURIComponent(window.location.pathname); window.location = Discourse.getURL('/session/sso?return_path=' + returnPath); } else { - this._autoLogin('login', () => this.controllerFor('login').resetForm()); + this._autoLogin('login', 'login-modal', () => this.controllerFor('login').resetForm()); } }, handleShowCreateAccount() { - this._autoLogin('createAccount'); + this._autoLogin('createAccount', 'create-account'); }, - _autoLogin(modal, notAuto) { + _autoLogin(modal, modalClass, notAuto) { const methods = Em.get('Discourse.LoginMethod.all'); if (!this.siteSettings.enable_local_logins && methods.length === 1) { this.controllerFor('login').send('externalLogin', methods[0]); } else { showModal(modal); + this.controllerFor('modal').set('modalClass', modalClass); if (notAuto) { notAuto(); } } }, diff --git a/app/assets/javascripts/discourse/templates/modal/modal.hbs b/app/assets/javascripts/discourse/templates/modal/modal.hbs index b7340453c78..4dd4c22b8a0 100644 --- a/app/assets/javascripts/discourse/templates/modal/modal.hbs +++ b/app/assets/javascripts/discourse/templates/modal/modal.hbs @@ -1,23 +1,19 @@ diff --git a/app/assets/stylesheets/common/base/modal.scss b/app/assets/stylesheets/common/base/modal.scss index 1aaf20cfcd7..d5aa63a9b3d 100644 --- a/app/assets/stylesheets/common/base/modal.scss +++ b/app/assets/stylesheets/common/base/modal.scss @@ -27,21 +27,31 @@ .modal-backdrop, .modal-backdrop.fade.in { -webkit-animation: fade .3s; - animation: fade .3s; + animation: fade .3s; opacity: .9; filter: alpha(opacity=90); } -//fade in - +// fade in @keyframes fade { - from {opacity: 0} - to {opacity: .9} + from { opacity: 0 } + to { opacity: .9 } } @-webkit-keyframes fade { - from {opacity: 0} - to {opacity: .9} + from { opacity: 0 } + to { opacity: .9 } +} + +// slide in +@keyframes slidein { + from { transform: translateY(-20%); } + to { transform: translateY(0); } +} + +@-webkit-keyframes slidein { + from { transform: translateY(-20%); } + to { transform: translateY(0); } } .modal-outer-container { @@ -61,6 +71,12 @@ background-clip: padding-box; } +.create-account.in .modal-inner-container, +.login-modal.in .modal-inner-container { + -webkit-animation: slidein .3s; + animation: slidein .3s; +} + .modal { position: fixed;