HomeHelpTrac

Changeset 15875


Ignore:
Timestamp:
01/15/12 20:41:26 (4 months ago)
Author:
Alexander Trofimov
Message:

Form - clear input button

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/inc/js/jquery.webForms.js

    r15850 r15875  
    267267                eWrapper.append('<a href="javascript:void(0);"><div style="display:none;" class="bx-form-input-btn-cross"></div></a>'); 
    268268 
     269                eInput.css('padding-right', parseInt(eInput.css('padding-right')) + 16 + 'px'); 
     270 
    269271                var eBtnCross = eWrapper.find('.bx-form-input-btn-cross'); 
    270                 var eLink = eWrapper.find('a'); 
    271  
    272                 eInput.css('padding-right', parseInt(eInput.css('padding-right')) + 16 + 'px'); 
    273  
    274                 eBtnCross.fadeIn(50, function () { // delay is needed here for dynamically displayed forms 
    275                     $(this).position({ 
    276                         of: eInput, 
    277                         my: 'right top', 
    278                         at: 'right top', 
    279                         collision: 'none none', 
    280                         offset: '-8 11' 
     272 
     273                eInput.on('focus', function () { 
     274                    eBtnCross.show().position({ 
     275                            of: $(this), 
     276                            my: 'right top', 
     277                            at: 'right top', 
     278                            collision: 'none none', 
     279                            offset: '-8 11' 
    281280                    }); 
    282281                }); 
    283282 
    284                 eBtnCross.on('click', function () { 
     283                eInput.on('blur', function (event) { 
     284                    eBtnCross.hide(); 
     285                }); 
     286                 
     287                eBtnCross.on('mousedown', function () { 
    285288                    eInput.val(''); 
    286                     if (!eInput.hasClass('bx-form-input-datetime') && !eInput.hasClass('bx-form-input-datepicker')) 
     289                    setTimeout(function () { 
    287290                        eInput.focus(); 
     291                    }, 100); 
    288292                }); 
    289293 
Note: See TracChangeset for help on using the changeset viewer.