summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2010-12-23 00:21:31 +0100
committerFelix Nagel <info@felixnagel.com>2010-12-23 00:21:31 +0100
commite552eade16bc3fc9dbb02f2861300cbdb4493fcc (patch)
tree188929a80894f3dd9128274fe18af3ac00fd3558
parent8a64e7c88b03b1b5b7e44d7e4b70f6504e8a107f (diff)
downloadjquery-ui-e552eade16bc3fc9dbb02f2861300cbdb4493fcc.tar.gz
jquery-ui-e552eade16bc3fc9dbb02f2861300cbdb4493fcc.zip
fixed: destroy method: wrapperElement option
-rw-r--r--ui/jquery.ui.selectmenu.js29
1 files changed, 17 insertions, 12 deletions
diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js
index 313a20b68..f89d0799c 100644
--- a/ui/jquery.ui.selectmenu.js
+++ b/ui/jquery.ui.selectmenu.js
@@ -364,21 +364,26 @@ $.widget("ui.selectmenu", {
}, 200);
},
destroy: function() {
- this.element.removeData(this.widgetName)
- .removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled')
- .removeAttr('aria-disabled')
- .unbind(".selectmenu");
+ this.element.removeData( this.widgetName )
+ .removeClass( this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled' )
+ .removeAttr( 'aria-disabled' )
+ .unbind( ".selectmenu" );
- $(window).unbind(".selectmenu");
- $(document).unbind(".selectmenu");
+ $( window ).unbind( ".selectmenu" );
+ $( document ).unbind( ".selectmenu" );
// unbind click on label, reset its for attr
- $('label[for='+this.newelement.attr('id')+']')
- .attr('for',this.element.attr('id'))
- .unbind('.selectmenu');
- this.newelement.remove();
- // FIXME option.wrapper needs
- this.list.remove();
+ $( 'label[for=' + this.newelement.attr('id') + ']' )
+ .attr( 'for', this.element.attr( 'id' ) )
+ .unbind( '.selectmenu' );
+
+ if ( o.wrapperElement ) {
+ this.newelement.find( o.wrapperElement ).remove();
+ this.list.find( o.wrapperElement ).remove();
+ } else {
+ this.newelement.remove();
+ this.list.remove();
+ }
this.element.show();
// call widget destroy function