Skip to content
Permalink
Browse files

Widget Factory: Check the target in getData and setData events (jQuer…

…y 1.3 supports bubbling for custom events).
  • Loading branch information
scottgonzalez committed Dec 31, 2008
1 parent 74f061c commit 30e4470a2c46847e6e4eb98f49f6399d01feb9c2
Showing with 6 additions and 2 deletions.
  1. +6 −2 ui/ui.core.js
@@ -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();

0 comments on commit 30e4470

Please sign in to comment.
You can’t perform that action at this time.