fixes to login page: removed not needed login.sass; removed fixed string length assumption; fixed login button not showing up in Chrome when the form is pre-filled

This commit is contained in:
MrZYX 2011-05-16 15:16:01 +02:00
parent 20231891d2
commit e338886910
4 changed files with 15 additions and 111 deletions

View file

@ -39,6 +39,7 @@
- if devise_mapping.rememberable?
= f.check_box :remember_me, :tabindex => 3
= f.label :remember_me, t('devise.sessions.new.remember_me')
%br
= f.submit t('devise.sessions.new.sign_in'), :tabindex => 4

View file

@ -15,6 +15,14 @@ $(document).ready( function(){
return($('#user_username').val() != "" && $('#user_password').val() != "");
}
var checkSubmitAvailability = function() {
if(contentFilled()){
controls.removeClass('hidden');
}else{
controls.addClass('hidden');
}
}
$("#login").center();
$(window).resize(function(){
$("#login").center();
@ -27,17 +35,13 @@ $(document).ready( function(){
controls.addClass('hidden');
});
$(document).keyup(function(){
if(contentFilled()){
controls.removeClass('hidden');
}else{
controls.addClass('hidden');
}
});
$(document).keyup(checkSubmitAvailability);
if(contentFilled()){
controls.removeClass('hidden');
}
// Check if the browser has pre-filled the form
checkSubmitAvailability();
// Check it again
setTimeout(checkSubmitAvailability, 1000);
password
.focus(function(){

View file

@ -1,89 +0,0 @@
// Copyright (c) 2010, Diaspora Inc. This file is
// licensed under the Affero General Public License version 3 or later. See
// the COPYRIGHT file.
@import 'mixins'
$blue: #3F8FBA
$red: #FF0000
$background: rgb(252,252,252)
body
:background-color $background
.hidden
:display none
#login
:width 600px
:padding
:top 10%
:bottom 20%
:text
:align center
:display inline-block
form
input,
label
:font
:size 14px
:display inline
label
:top 10px
:left 12px
:text-shadow none
input[type='text'],
input[type='password']
:-webkit-box-shadow 0 1px 0px #fff, 0 -1px 0px #888
:-moz-box-shadow 0 1px 0px #fff, 0 -1px 0px #888
:box-shadow 0 1px 0px #fff, 0 -1px 0px #888
:width 180px
:max-width 180px
p
:display inline-block
:position relative
:width 200px
span
:display inline-block
&.submit
:width auto
:bottom 15px
input
:width auto
:position relative
:height 40px
:top 0px
:color #666
:margin
:bottom 10px
&:hover
:color #444
#forgot_password_link
:text-align left
:position absolute
:left 205px
:top 12px
:width 150px
:color #999
.controls.hidden
:display none
#remember_me
:position absolute
:top 0
:left 4px
#user_submit
:position absolute
:top -6px
:right 5px

View file

@ -84,18 +84,6 @@
@include opacity(0);
}
}
#remember_me {
position: absolute;
top: 0;
left: 4px;
}
#user_submit {
position: absolute;
top: -6px;
right: 5px;
}
}
}