Make .data(Object) extend the existing data object. Fixes #6692.

This commit is contained in:
jeresig
2010-09-22 11:52:32 -04:00
parent 626624a19a
commit 0b4b3ee8a5
2 changed files with 8 additions and 4 deletions

View File

@@ -52,9 +52,10 @@ jQuery.extend({
// want to manipulate it.
if ( typeof name === "object" ) {
if ( isNode ) {
cache[ id ] = jQuery.extend(true, {}, name);
cache[ id ] = jQuery.extend(cache[ id ], name);
} else {
store = jQuery.extend(true, {}, name);
store = jQuery.extend(cache[ id ], name);
cache[ id ] = function() {
return store;
};
@@ -63,6 +64,7 @@ jQuery.extend({
} else if ( !cache[ id ] ) {
if ( isNode ) {
cache[ id ] = {};
} else {
store = {};
cache[ id ] = function() {