Skip to main content

Bug Tracker

Side navigation

Ticket #4878: attributes.diff


File attributes.diff, 0.8 KB (added by bennettmcelwee, July 15, 2009 12:36AM UTC)

Proper patch file for rev 6333.

Index: attributes.js
===================================================================
--- attributes.js	(revision 6333)
+++ attributes.js	(working copy)
@@ -98,11 +98,15 @@
 					jQuery.inArray(this.name, value) >= 0);
 
 			else if ( jQuery.nodeName( this, "select" ) ) {
-				var values = jQuery.makeArray(value);
+				var values = jQuery.makeArray(value),
+					one = this.type == "select-one",
+					canSelect = true;
 
 				jQuery( "option", this ).each(function(){
-					this.selected = (jQuery.inArray( this.value, values ) >= 0 ||
+					this.selected = canSelect && (jQuery.inArray( this.value, values ) >= 0 ||
 						jQuery.inArray( this.text, values ) >= 0);
+					if (this.selected && one)
+						canSelect = false;
 				});
 
 				if ( !values.length )

Download in other formats:

Original Format