diff --git a/core/client/assets/sass/layouts/login.scss b/core/client/assets/sass/layouts/login.scss
index ca876fa06d..af5533a0a8 100644
--- a/core/client/assets/sass/layouts/login.scss
+++ b/core/client/assets/sass/layouts/login.scss
@@ -18,16 +18,18 @@
background: $darkgrey;
}
- main {
- top: 0;
+ main {
+ top: 15px;
}
+
}//.ghost-login
.login-box {
max-width: 530px;
+ height: 90%;
margin: 0 auto;
padding: 0;
- display: none;
+ display: table;
@include breakpoint(630px) {
max-width: 264px;
@@ -39,6 +41,8 @@
@include box-sizing(border-box);
max-width: 530px;
color: lighten($midgrey, 15%);
+ display: table-cell;
+ vertical-align: middle;
@include breakpoint(630px) {
max-width: 264px;
diff --git a/core/client/router.js b/core/client/router.js
index b3001bc61a..b3152f7ac9 100644
--- a/core/client/router.js
+++ b/core/client/router.js
@@ -19,15 +19,15 @@
},
signup: function () {
- Ghost.currentView = new Ghost.Views.Signup({ el: '.js-login-container' });
+ Ghost.currentView = new Ghost.Views.Signup({ el: '.js-login-box' });
},
login: function () {
- Ghost.currentView = new Ghost.Views.Login({ el: '.js-login-container' });
+ Ghost.currentView = new Ghost.Views.Login({ el: '.js-login-box' });
},
forgotten: function () {
- Ghost.currentView = new Ghost.Views.Forgotten({ el: '.js-login-container' });
+ Ghost.currentView = new Ghost.Views.Forgotten({ el: '.js-login-box' });
},
blog: function () {
diff --git a/core/client/tpl/login.hbs b/core/client/tpl/login.hbs
index 4bdc85d2a0..c09f6ace74 100644
--- a/core/client/tpl/login.hbs
+++ b/core/client/tpl/login.hbs
@@ -7,6 +7,6 @@
diff --git a/core/client/views/login.js b/core/client/views/login.js
index c3c1edce8e..d813bc13f9 100644
--- a/core/client/views/login.js
+++ b/core/client/views/login.js
@@ -6,37 +6,9 @@
Ghost.SimpleFormView = Ghost.View.extend({
initialize: function () {
this.render();
- $(window).trigger('resize');
- },
-
- afterRender: function () {
- var self = this;
-
- $(window).on('resize', self.centerOnResize);
-
- $(window).one('centered', self.fadeInAndFocus);
- },
-
- fadeInAndFocus: function () {
- $(".js-login-container").fadeIn(750, function () {
+ $(".js-login-box").fadeIn(500, function () {
$("[name='email']").focus();
});
- },
-
- centerOnResize: _.debounce(function (e) {
- var container = $(".js-login-container");
- container.css({
- 'position': 'relative'
- }).animate({
- 'top': Math.round($(window).height() / 2) - container.outerHeight() / 2 + 'px'
- });
- $(window).trigger("centered");
- }, 100),
-
- remove: function () {
- var self = this;
- $(window).off('resize', self.centerOnResize);
- $(window).off('centered', self.fadeInAndFocus);
}
});
diff --git a/core/server/views/login.hbs b/core/server/views/login.hbs
index 6faca90ae5..8b28bdc67a 100644
--- a/core/server/views/login.hbs
+++ b/core/server/views/login.hbs
@@ -1,4 +1,4 @@
{{!< default}}
-
+
diff --git a/core/server/views/signup.hbs b/core/server/views/signup.hbs
index 6faca90ae5..8b28bdc67a 100644
--- a/core/server/views/signup.hbs
+++ b/core/server/views/signup.hbs
@@ -1,4 +1,4 @@
{{!< default}}
-
+
diff --git a/core/test/functional/admin/01_login_test.js b/core/test/functional/admin/01_login_test.js
index 2962e39275..7c54411349 100644
--- a/core/test/functional/admin/01_login_test.js
+++ b/core/test/functional/admin/01_login_test.js
@@ -15,12 +15,12 @@ casper.test.begin('Ensure Session is Killed', 1, function suite(test) {
casper.test.begin('Ensure a User is Registered', 2, function suite(test) {
test.filename = 'login_user_registered_test.png';
- casper.start(url + 'ghost/signup/');
+ casper.start(url + 'ghost/signup/').viewport(1280, 1024);
casper.waitFor(function checkOpaque() {
return this.evaluate(function () {
var loginBox = document.querySelector('.login-box');
- return window.getComputedStyle(loginBox).getPropertyValue('display') === "block"
+ return window.getComputedStyle(loginBox).getPropertyValue('display') === "table"
&& window.getComputedStyle(loginBox).getPropertyValue('opacity') === "1";
});
}, function then() {
@@ -90,11 +90,13 @@ casper.test.begin("Can't spam it", 4, function suite(test) {
return this.evaluate(function () {
var loginBox = document.querySelector('.login-box');
- return window.getComputedStyle(loginBox).getPropertyValue('display') === "block"
+ return window.getComputedStyle(loginBox).getPropertyValue('display') === "table"
&& window.getComputedStyle(loginBox).getPropertyValue('opacity') === "1";
});
}, function then() {
this.fill("#login", falseUser, true);
+ }, function onTimeout() {
+ test.fail('Sign in form didn\'t fade in.');
});
casper.wait(200, function doneWait() {
@@ -109,6 +111,10 @@ casper.test.begin("Can't spam it", 4, function suite(test) {
test.assert(false, 'Spamming the login did not result in an error notification');
});
+ // This test causes the spam notification
+ // add a wait to ensure future tests don't get tripped up by this.
+ casper.wait(1000);
+
casper.run(function () {
test.done();
});
@@ -124,7 +130,7 @@ casper.test.begin("Can login to Ghost", 4, function suite(test) {
casper.waitFor(function checkOpaque() {
return casper.evaluate(function () {
var loginBox = document.querySelector('.login-box');
- return window.getComputedStyle(loginBox).getPropertyValue('display') === "block"
+ return window.getComputedStyle(loginBox).getPropertyValue('display') === "table"
&& window.getComputedStyle(loginBox).getPropertyValue('opacity') === "1";
});
}, function then() {
diff --git a/core/test/functional/admin/07_logout_test.js b/core/test/functional/admin/07_logout_test.js
index e811224466..d9eadc59fb 100644
--- a/core/test/functional/admin/07_logout_test.js
+++ b/core/test/functional/admin/07_logout_test.js
@@ -43,7 +43,7 @@ casper.test.begin("Can't spam signin", 3, function suite(test) {
casper.waitFor(function checkOpaque() {
return this.evaluate(function () {
var loginBox = document.querySelector('.login-box');
- return window.getComputedStyle(loginBox).getPropertyValue('display') === "block"
+ return window.getComputedStyle(loginBox).getPropertyValue('display') === "table"
&& window.getComputedStyle(loginBox).getPropertyValue('opacity') === "1";
});
}, function then() {