Permalink
Browse files

Controlgroup: Implement _destroy().

  • Loading branch information...
gabrielschulhof committed Jul 15, 2013
1 parent dc9bf3e commit ebd849903a8a0cbce721650bcc9f5bb1645fe00d
Showing with 19 additions and 0 deletions.
  1. +19 −0 js/widgets/controlgroup.js
View
@@ -116,6 +116,25 @@ $.widget( "mobile.controlgroup", $.extend( {
}
this._addFirstLastClasses( els, this.options.excludeInvisible ? this._getVisibles( els, create ) : els, create );
this._initialRefresh = false;
},
_destroy: function() {
var ui, elem;
if ( this.options.enhanced ) {
return this;
}
ui = this._ui;
elem = this.element;
this._removeFirstLastClasses( elem.find( ".ui-btn" ).not( ".ui-slider-handle" ) );
this.element
.prepend( ui.groupLegend.children() )
.removeClass( "ui-controlgroup " + this._classes );
ui.childWrapper.children().unwrap();
ui.groupLegend.remove();
}
}, $.mobile.behaviors.addFirstLastClasses ) );

0 comments on commit ebd8499

Please sign in to comment.