Changeset 14435
- Timestamp:
- 01/15/08 19:13:18 (11 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/midcom.helper.datamanager2/static/chooser/jquery.chooser_widget.js
r14426 r14435 255 255 case KEY.TAB: 256 256 case KEY.RETURN: 257 event.preventDefault(); 257 258 if( selectCurrent() ) 258 259 { 259 260 input_element.focus(); 260 event.preventDefault(); 261 261 262 } 262 263 break; … … 308 309 create_button = jQuery('#' + options.widget_id + '_create_button'); 309 310 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 } 315 316 var creation_url = options.creation_handler; 316 317 … … 544 545 else 545 546 { 546 // Remove activation from each list element547 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 failed552 if ( !id553 || !id[1]554 || id[1] == item_id)555 {556 return;557 }558 559 // Inactivate560 inactivate(id[1]);561 });562 563 547 activate(item_id); 564 548 } … … 647 631 function activate(id) 648 632 { 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 649 653 jQuery('#'+options.widget_id + '_result_item_'+id+'_input', list).attr({ value: id }); 650 654 jQuery('#'+options.widget_id + '_result_item_'+id).removeClass(CLASSES.DELETED);
