Skip to main content

Bug Tracker

Side navigation

Ticket #2768: 2768-data_from_hash.diff
File 2768-data_from_hash.diff, 0.4 KB (added by Morgan, May 14, 2008 05:19AM UTC)

add data from hash

Index: src/core.js
===================================================================
--- src/core.js	(revision 5588)
+++ src/core.js	(working copy)
@@ -458,6 +458,13 @@
 	},
 
 	data: function( key, value ){
+		if(typeof key == "object")
+		{
+		  for(k in key)
+			$(this).data(k,key[k]);
+		  return this;
+		}
+
 		var parts = key.split(".");
 		parts[1] = parts[1] ? "." + parts[1] : "";

Download in other formats:

Original Format