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:
parent
20231891d2
commit
e338886910
4 changed files with 15 additions and 111 deletions
|
|
@ -39,6 +39,7 @@
|
||||||
- if devise_mapping.rememberable?
|
- if devise_mapping.rememberable?
|
||||||
= f.check_box :remember_me, :tabindex => 3
|
= f.check_box :remember_me, :tabindex => 3
|
||||||
= f.label :remember_me, t('devise.sessions.new.remember_me')
|
= f.label :remember_me, t('devise.sessions.new.remember_me')
|
||||||
|
%br
|
||||||
= f.submit t('devise.sessions.new.sign_in'), :tabindex => 4
|
= f.submit t('devise.sessions.new.sign_in'), :tabindex => 4
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,14 @@ $(document).ready( function(){
|
||||||
var contentFilled = function(){
|
var contentFilled = function(){
|
||||||
return($('#user_username').val() != "" && $('#user_password').val() != "");
|
return($('#user_username').val() != "" && $('#user_password').val() != "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var checkSubmitAvailability = function() {
|
||||||
|
if(contentFilled()){
|
||||||
|
controls.removeClass('hidden');
|
||||||
|
}else{
|
||||||
|
controls.addClass('hidden');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$("#login").center();
|
$("#login").center();
|
||||||
$(window).resize(function(){
|
$(window).resize(function(){
|
||||||
|
|
@ -27,17 +35,13 @@ $(document).ready( function(){
|
||||||
controls.addClass('hidden');
|
controls.addClass('hidden');
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).keyup(function(){
|
$(document).keyup(checkSubmitAvailability);
|
||||||
if(contentFilled()){
|
|
||||||
controls.removeClass('hidden');
|
|
||||||
}else{
|
|
||||||
controls.addClass('hidden');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if(contentFilled()){
|
// Check if the browser has pre-filled the form
|
||||||
controls.removeClass('hidden');
|
checkSubmitAvailability();
|
||||||
}
|
|
||||||
|
// Check it again
|
||||||
|
setTimeout(checkSubmitAvailability, 1000);
|
||||||
|
|
||||||
password
|
password
|
||||||
.focus(function(){
|
.focus(function(){
|
||||||
|
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
||||||
|
|
@ -84,18 +84,6 @@
|
||||||
@include opacity(0);
|
@include opacity(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#remember_me {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#user_submit {
|
|
||||||
position: absolute;
|
|
||||||
top: -6px;
|
|
||||||
right: 5px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue