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

Commit 9943c87

Browse files
author
Gabriel Schulhof
committed
Collapsible set: Implement _destroy().
1 parent b860536 commit 9943c87

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

js/widgets/collapsibleSet.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ define( [
1414
//>>excludeEnd("jqmBuildExclude");
1515
(function( $, undefined ) {
1616

17-
var childCollapsiblesSelector = ":mobile-collapsible, :jqmData(role='collapsible')";
17+
var childCollapsiblesSelector = ":mobile-collapsible, " + $.mobile.collapsible.initSelector;
1818

1919
$.widget( "mobile.collapsibleset", $.extend( {
2020
options: $.extend( {}, $.mobile.collapsible.defaults ),
@@ -82,6 +82,16 @@ $.widget( "mobile.collapsibleset", $.extend( {
8282
return ret;
8383
},
8484

85+
_destroy: function() {
86+
var el = this.element;
87+
88+
this._removeFirstLastClasses( el.children( childCollapsiblesSelector ) );
89+
el
90+
.removeClass( "ui-collapsible-set " + this._classes )
91+
.children( ":mobile-collapsible" )
92+
.collapsible( "destroy" );
93+
},
94+
8595
_refresh: function( create ) {
8696
var collapsiblesInSet = this.element.children( childCollapsiblesSelector );
8797

0 commit comments

Comments
 (0)