| | |
| | | var input, |
| | | self = this, |
| | | select = this.element, |
| | | internal = false, |
| | | selected = select.children( ":selected" ), |
| | | value = selected.val() ? selected.text() : "", |
| | | wrapper = this.wrapper = $( "<span>" ) |
| | | .addClass( "ui-combobox" ) |
| | | .insertAfter( select ); |
| | | |
| | | |
| | | input = $( "<input>" ).css( { "width": (select.is(':visible') ? (elwidth > 15 ? elwidth - 15 : 1) : 350), "height": (elheight > 0 ? elheight : 16) }); |
| | | select.hide(); |
| | | input.appendTo( wrapper ) |
| | |
| | | response( select.children( "option" ).map(function() { |
| | | var text = $( this ).text(); |
| | | //if ( this.value && ( !request.term || matcher.test(text) ) ) |
| | | if ( !request.term || matcher.test(text) ) |
| | | if ( (!request.term || matcher.test(text)) && $(this).css('display') != 'none' ) |
| | | return { |
| | | label: (text == "" ? " " : text.replace( |
| | | new RegExp( |
| | |
| | | } else if($(select).attr('onchange')) { |
| | | eval($(select).attr('onchange')); |
| | | } else { |
| | | if(!ui.item.internal) $(select).change(); |
| | | if(!ui.item.internal) { |
| | | internal = true; |
| | | $(select).change(); |
| | | } |
| | | } |
| | | if (jQuery(".panel #Filter").length > 0) { |
| | | jQuery(".panel #Filter").trigger('click'); |
| | |
| | | matchtext = $(this).val(); |
| | | valid = false; |
| | | select.children( "option" ).each(function() { |
| | | if( ($(this).text() == "" && matchtext == "") || $( this ).text().match( matcher ) ) { |
| | | if( (($(this).text() == "" && matchtext == "") || $( this ).text().match( matcher )) && $(this).css('display') != 'none' ) { |
| | | select.val($(this).val()); |
| | | this.selected = valid = true; |
| | | return false; |
| | |
| | | valid = false, |
| | | selected = false; |
| | | select.children( "option" ).each(function() { |
| | | if( ($(this).val() == "" && matchtext == "") || $( this ).text().match( matcher ) ) { |
| | | if( (($(this).val() == "" && matchtext == "") || $( this ).text().match( matcher )) && $(this).css('display') != 'none' ) { |
| | | valid = true; |
| | | selected = $(this); |
| | | return false; |
| | |
| | | return el; |
| | | }; |
| | | select.change(function(e) { |
| | | if(internal == true) { |
| | | internal = false; |
| | | return; |
| | | } |
| | | var matcher = new RegExp( "" + $.ui.autocomplete.escapeRegex( $(this).val() ) + "", "i" ), |
| | | matchtext = $(this).val(); |
| | | valid = false, |
| | | selected = false; |
| | | select.children( "option" ).each(function() { |
| | | if( ($(this).val() == "" && matchtext == "") || $( this ).text().match( matcher ) ) { |
| | | if( (($(this).val() == "" && matchtext == "") || $( this ).text().match( matcher )) && $(this).css('display') != 'none' ) { |
| | | valid = true; |
| | | selected = $(this); |
| | | return false; |