Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- setupLoginForm: function() {
- $("#signin-button").click( function(event) {
- event.stopPropagation();
- var formWrapper = $("#block-user-login-form-wrapper");
- if (formWrapper.position().top) {
- $("#block-user-login-form-wrapper").stop().animate({
- top: "0px"
- });
- $(this).removeClass("enabled");
- } else {
- $("#block-user-login-form-wrapper").stop().animate({
- top: "-128px"
- }, null, null, function() {
- $("#signin-button").addClass("enabled");
- });
- }
- });
- $("#signin-button").qtip({
- content: {
- text: "Accedi al sito con il tuo account"
- },
- position: {
- target: 'mouse',
- adjust: {
- x: 10,
- y: 10
- }
- }
- });
- $("#block-user-login-form").click( function(event) {
- event.stopPropagation();
- });
- $('html').click( function(event) {
- var formWrapper = $("#block-user-login-form-wrapper");
- if (formWrapper != null && formWrapper.position() != null && formWrapper.position().top == 0) {
- $("#block-user-login-form-wrapper").stop().animate({
- top: "-128px"
- }, null, null, function() {
- $("#signin-button").addClass("enabled");
- });
- event.stopPropagation();
- }
- });
- $("#user-login-form").validate({
- showErrors: function(errorMap, errorList) {
- $(errorList).each( function(index, value) {
- //$(value.element.parentNode).children("label").hide();
- var label = $(value.element.parentNode).children("label");
- var defaultColor = label.css("color");
- label.animate({
- color: "red"
- }, 250, "swing", function() {
- $(this).animate({
- color: defaultColor
- }, 1000);
- });
- });
- },
- focusCleanup: true,
- focusInvalid: false,
- unhighlight: function(element, errorClass, validClass) {
- $(element.form).find("label[for=" + element.id + "]").show();
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement