Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit ebd8499

Browse files
author
Gabriel Schulhof
committed
Controlgroup: Implement _destroy().
1 parent dc9bf3e commit ebd8499

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

js/widgets/controlgroup.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,25 @@ $.widget( "mobile.controlgroup", $.extend( {
116116
}
117117
this._addFirstLastClasses( els, this.options.excludeInvisible ? this._getVisibles( els, create ) : els, create );
118118
this._initialRefresh = false;
119+
},
120+
121+
_destroy: function() {
122+
var ui, elem;
123+
124+
if ( this.options.enhanced ) {
125+
return this;
126+
}
127+
128+
ui = this._ui;
129+
elem = this.element;
130+
131+
this._removeFirstLastClasses( elem.find( ".ui-btn" ).not( ".ui-slider-handle" ) );
132+
133+
this.element
134+
.prepend( ui.groupLegend.children() )
135+
.removeClass( "ui-controlgroup " + this._classes );
136+
ui.childWrapper.children().unwrap();
137+
ui.groupLegend.remove();
119138
}
120139
}, $.mobile.behaviors.addFirstLastClasses ) );
121140

0 commit comments

Comments
 (0)