diff options
author | Marc-Andre Lafortune <github@marc-andre.ca> | 2012-10-07 02:35:01 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-10-23 14:06:30 -0400 |
commit | 8bb05d23e2c49ecbe2f83a3552efb0a93c48bb85 (patch) | |
tree | da81b6f0550a347b6f38afb56f1e9cb0d86b9da6 /ui | |
parent | b1b07e8046aa0f0b543ade96eb28567af68efb81 (diff) | |
download | jquery-ui-8bb05d23e2c49ecbe2f83a3552efb0a93c48bb85.tar.gz jquery-ui-8bb05d23e2c49ecbe2f83a3552efb0a93c48bb85.zip |
Widget: Destroy only when element is the actual target. Fixes #8652 - Widget: Destroy only when element is the actual target.
Diffstat (limited to 'ui')
-rw-r--r-- | ui/jquery.ui.widget.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js index 05487f7ed..ccbe0cac5 100644 --- a/ui/jquery.ui.widget.js +++ b/ui/jquery.ui.widget.js @@ -237,7 +237,13 @@ $.Widget.prototype = { // TODO remove dual storage $.data( element, this.widgetName, this ); $.data( element, this.widgetFullName, this ); - this._on({ remove: "destroy" }); + this._on({ + remove: function( event ) { + if ( event.target === element ) { + this.destroy(); + } + } + }); this.document = $( element.style ? // element within the document element.ownerDocument : |