Changeset 14435

Show
Ignore:
Timestamp:
01/15/08 19:13:18 (11 months ago)
Author:
flack
Message:

fixes for some keyboard navigation problems

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/midcom.helper.datamanager2/static/chooser/jquery.chooser_widget.js

    r14426 r14435  
    255255            case KEY.TAB: 
    256256            case KEY.RETURN: 
     257                event.preventDefault(); 
    257258                if( selectCurrent() ) 
    258259                { 
    259260                    input_element.focus(); 
    260                     event.preventDefault(); 
     261 
    261262                } 
    262263                break; 
     
    308309        create_button = jQuery('#' + options.widget_id + '_create_button'); 
    309310        create_button.bind('click', function(){ 
    310                if (jQuery('#' + options.widget_id + '_creation_dialog').css('display') == 'block') 
    311                { 
    312                   jQuery('#' + options.widget_id + '_creation_dialog').hide(); 
    313                   return; 
    314                } 
     311            if (jQuery('#' + options.widget_id + '_creation_dialog').css('display') == 'block') 
     312            { 
     313               jQuery('#' + options.widget_id + '_creation_dialog').hide(); 
     314               return; 
     315            } 
    315316            var creation_url = options.creation_handler; 
    316317             
     
    544545            else 
    545546            { 
    546                 // Remove activation from each list element 
    547                 jQuery(this.parentNode).find('li.' + CLASSES.ACTIVE).each(function(i) 
    548                 { 
    549                     var id = this.id.match(/_([0-9]+)$/); 
    550                      
    551                     // Skip the selected or match failed 
    552                     if (   !id 
    553                         || !id[1] 
    554                         || id[1] == item_id) 
    555                     { 
    556                         return; 
    557                     } 
    558                      
    559                     // Inactivate 
    560                     inactivate(id[1]); 
    561                 }); 
    562                  
    563547                activate(item_id); 
    564548            } 
     
    647631    function activate(id) 
    648632    { 
     633        if (!options.allow_multiple) 
     634        { 
     635            // Remove activation from each list element 
     636            jQuery(this.parent).find('li.' + CLASSES.ACTIVE).each(function(i) 
     637                { 
     638                    var id = this.id.match(/_([0-9]+)$/); 
     639                     
     640                    // Skip the selected or match failed 
     641                    if (   !id 
     642                        || !id[1] 
     643                        || id[1] == id) 
     644                    { 
     645                        return; 
     646                    } 
     647                     
     648                    // Inactivate 
     649                    inactivate(id[1]); 
     650                }); 
     651        } 
     652 
    649653        jQuery('#'+options.widget_id + '_result_item_'+id+'_input', list).attr({ value: id }); 
    650654        jQuery('#'+options.widget_id + '_result_item_'+id).removeClass(CLASSES.DELETED);