diff --git a/lms/static/js/student_account/views/AccessView.js b/lms/static/js/student_account/views/AccessView.js index 3465d333bc..f9939c46a1 100644 --- a/lms/static/js/student_account/views/AccessView.js +++ b/lms/static/js/student_account/views/AccessView.js @@ -29,7 +29,7 @@ var edx = edx || {}; * (all but include, contains, and reverse) into the * Underscore namespace */ - _.mixin(_.str.exports()) + _.mixin( _.str.exports() ); this.tpl = $(this.tpl).html(); this.activeForm = obj.mode || 'login'; @@ -132,7 +132,8 @@ var edx = edx || {}; toggleForm: function( e ) { var type = $(e.currentTarget).val(), - $form = $('#' + type + '-form'); + $form = $('#' + type + '-form'), + $anchor = $('#' + type + '-anchor'); if ( !this.form.isLoaded( $form ) ) { this.loadForm( type ); @@ -140,6 +141,11 @@ var edx = edx || {}; this.element.hide( $(this.el).find('.form-wrapper') ); this.element.show( $form ); + + // Scroll to top of selected form + $('html,body').animate({ + scrollTop: $anchor.offset().top + },'slow'); }, form: { diff --git a/lms/static/js/student_account/views/LoginView.js b/lms/static/js/student_account/views/LoginView.js index 2812d0c3c1..0480731c40 100644 --- a/lms/static/js/student_account/views/LoginView.js +++ b/lms/static/js/student_account/views/LoginView.js @@ -73,9 +73,6 @@ var edx = edx || {}; if (providerUrl) { window.location.href = providerUrl; - } else { - // TODO -- error handling here - console.log('No URL available for third party auth provider'); } }, diff --git a/lms/static/js/student_account/views/RegisterView.js b/lms/static/js/student_account/views/RegisterView.js index 872f42ae76..ec3b4ff287 100644 --- a/lms/static/js/student_account/views/RegisterView.js +++ b/lms/static/js/student_account/views/RegisterView.js @@ -28,8 +28,9 @@ var edx = edx || {}; var fields = html || ''; $(this.el).html( _.template( this.tpl, { - // We pass the context object to the template so that - // we can perform variable interpolation using sprintf + /* We pass the context object to the template so that + * we can perform variable interpolation using sprintf + */ context: { fields: fields, currentProvider: this.currentProvider, @@ -46,11 +47,8 @@ var edx = edx || {}; thirdPartyAuth: function( event ) { var providerUrl = $(event.target).data('provider-url') || ''; - if (providerUrl) { + if ( providerUrl ) { window.location.href = providerUrl; - } else { - // TODO -- error handling here - console.log('No URL available for third party auth provider'); } } }); diff --git a/lms/static/sass/views/_login-register.scss b/lms/static/sass/views/_login-register.scss index e2e0d6ada1..fd11e73b5a 100644 --- a/lms/static/sass/views/_login-register.scss +++ b/lms/static/sass/views/_login-register.scss @@ -130,6 +130,7 @@ .form-field { @include clearfix; clear: both; + position: relative; width: 100%; margin: 0 0 $baseline 0; @@ -166,7 +167,6 @@ .field-link { position: relative; - float: right; color: $link-color-d1; font-weight: $font-regular; text-decoration: none !important; // needed but nasty @@ -371,6 +371,12 @@ @extend %inline-form-field-tablet; width: calc( 50% - 10px ); } + + .field-link { + position: absolute; + top: 0; + right: 0; + } } } @@ -412,6 +418,12 @@ @extend %inline-form-field-desktop; width: 100px; } + + .field-link { + position: absolute; + top: 0; + right: 0; + } } .login-provider { diff --git a/lms/templates/student_account/access.underscore b/lms/templates/student_account/access.underscore index 959ee6ec06..5eb739fd67 100644 --- a/lms/templates/student_account/access.underscore +++ b/lms/templates/student_account/access.underscore @@ -3,7 +3,17 @@
<%- gettext("Log in or register to take courses from the world's best universities.") %>
-