jquery core: saving some bytes in $.fn.val by using $.makeArray.
This commit is contained in:
parent
da76a723e1
commit
3a7b09e5c7
|
@ -410,9 +410,7 @@ jQuery.fn = jQuery.prototype = {
|
||||||
jQuery.inArray(this.name, value) >= 0);
|
jQuery.inArray(this.name, value) >= 0);
|
||||||
|
|
||||||
else if ( jQuery.nodeName( this, "select" ) ) {
|
else if ( jQuery.nodeName( this, "select" ) ) {
|
||||||
var values = value.constructor == Array ?
|
var values = jQuery.makeArray(value);
|
||||||
value :
|
|
||||||
[ value ];
|
|
||||||
|
|
||||||
jQuery( "option", this ).each(function(){
|
jQuery( "option", this ).each(function(){
|
||||||
this.selected = (jQuery.inArray( this.value, values ) >= 0 ||
|
this.selected = (jQuery.inArray( this.value, values ) >= 0 ||
|
||||||
|
|
Loading…
Reference in a new issue