Widget Factory: Check the target in getData and setData events (jQuery 1.3 supports bubbling for custom events).

This commit is contained in:
Scott González 2008-12-31 14:28:56 +00:00
parent 74f061c716
commit 30e4470a2c

View File

@ -312,10 +312,14 @@ $.widget = function(name, prototype) {
this.element = $(element)
.bind('setData.' + name, function(event, key, value) {
return self._setData(key, value);
if (event.target == element) {
return self._setData(key, value);
}
})
.bind('getData.' + name, function(event, key) {
return self._getData(key);
if (event.target == element) {
return self._getData(key);
}
})
.bind('remove', function() {
return self.destroy();