Skip to content

Commit ac099fb

Browse files
committed
Accordion: Remove deprecated height options. Fixes #5868 - Accordion: Remove clearStyle option. Fixes #5872 - Accordion: Remove autoHeight and fillSpace options.
1 parent 721a4b4 commit ac099fb

File tree

3 files changed

+1
-123
lines changed

3 files changed

+1
-123
lines changed

tests/unit/accordion/accordion_common_deprecated.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@ TestHelpers.commonWidgetTests( "accordion", {
33
active: 0,
44
animate: null,
55
animated: "slide",
6-
autoHeight: true,
7-
clearStyle: false,
86
collapsible: false,
97
disabled: false,
108
event: "click",
11-
fillSpace: false,
129
header: "> li > :first-child,> :not(li):even",
13-
heightStyle: null,
10+
heightStyle: "auto",
1411
icons: {
1512
"activeHeader": null,
1613
"header": "ui-icon-triangle-1-e",

tests/unit/accordion/accordion_deprecated.js

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -104,80 +104,6 @@ test( "{ active: jQuery Object }", function() {
104104

105105

106106

107-
108-
module( "accordion (deprecated) - height options", setupTeardown() );
109-
110-
test( "{ autoHeight: true }, default", function() {
111-
expect( 3 );
112-
equalHeight( $( "#navigation" ).accordion({ autoHeight: true }), 105 );
113-
});
114-
115-
test( "{ autoHeight: false }", function() {
116-
expect( 3 );
117-
var element = $( "#navigation" ).accordion({ autoHeight: false }),
118-
sizes = [];
119-
element.find( ".ui-accordion-content" ).each(function() {
120-
sizes.push( $(this).height() );
121-
});
122-
ok( sizes[0] >= 70 && sizes[0] <= 105, "was " + sizes[0] );
123-
ok( sizes[1] >= 98 && sizes[1] <= 126, "was " + sizes[1] );
124-
ok( sizes[2] >= 42 && sizes[2] <= 54, "was " + sizes[2] );
125-
});
126-
127-
test( "{ fillSpace: true }", function() {
128-
expect( 3 );
129-
$( "#navigationWrapper" ).height( 500 );
130-
var element = $( "#navigation" ).accordion({ fillSpace: true });
131-
equalHeight( element, 455 );
132-
});
133-
134-
test( "{ fillSapce: true } with sibling", function() {
135-
expect( 3 );
136-
$( "#navigationWrapper" ).height( 500 );
137-
$( "<p>Lorem Ipsum</p>" )
138-
.css({
139-
height: 50,
140-
marginTop: 20,
141-
marginBottom: 30
142-
})
143-
.prependTo( "#navigationWrapper" );
144-
var element = $( "#navigation" ).accordion({ fillSpace: true });
145-
equalHeight( element , 355 );
146-
});
147-
148-
test( "{ fillSpace: true } with multiple siblings", function() {
149-
expect( 3 );
150-
$( "#navigationWrapper" ).height( 500 );
151-
$( "<p>Lorem Ipsum</p>" )
152-
.css({
153-
height: 50,
154-
marginTop: 20,
155-
marginBottom: 30
156-
})
157-
.prependTo( "#navigationWrapper" );
158-
$( "<p>Lorem Ipsum</p>" )
159-
.css({
160-
height: 50,
161-
marginTop: 20,
162-
marginBottom: 30,
163-
position: "absolute"
164-
})
165-
.prependTo( "#navigationWrapper" );
166-
$( "<p>Lorem Ipsum</p>" )
167-
.css({
168-
height: 25,
169-
marginTop: 10,
170-
marginBottom: 15
171-
})
172-
.prependTo( "#navigationWrapper" );
173-
var element = $( "#navigation" ).accordion({ fillSpace: true });
174-
equalHeight( element, 305 );
175-
});
176-
177-
178-
179-
180-
181107
module( "accordion (deprecated) - icons", setupTeardown() );
182108

183109
test( "icons, headerSelected", function() {

ui/jquery.ui.accordion.js

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -576,51 +576,6 @@ if ( $.uiBackCompat !== false ) {
576576
};
577577
}( jQuery, jQuery.ui.accordion.prototype ) );
578578

579-
// height options
580-
(function( $, prototype ) {
581-
$.extend( prototype.options, {
582-
heightStyle: null, // remove default so we fall back to old values
583-
autoHeight: true, // use heightStyle: "auto"
584-
clearStyle: false, // use heightStyle: "content"
585-
fillSpace: false // use heightStyle: "fill"
586-
});
587-
588-
var _create = prototype._create,
589-
_setOption = prototype._setOption;
590-
591-
$.extend( prototype, {
592-
_create: function() {
593-
this.options.heightStyle = this.options.heightStyle ||
594-
this._mergeHeightStyle();
595-
596-
_create.call( this );
597-
},
598-
599-
_setOption: function( key ) {
600-
if ( key === "autoHeight" || key === "clearStyle" || key === "fillSpace" ) {
601-
this.options.heightStyle = this._mergeHeightStyle();
602-
}
603-
_setOption.apply( this, arguments );
604-
},
605-
606-
_mergeHeightStyle: function() {
607-
var options = this.options;
608-
609-
if ( options.fillSpace ) {
610-
return "fill";
611-
}
612-
613-
if ( options.clearStyle ) {
614-
return "content";
615-
}
616-
617-
if ( options.autoHeight ) {
618-
return "auto";
619-
}
620-
}
621-
});
622-
}( jQuery, jQuery.ui.accordion.prototype ) );
623-
624579
// icon options
625580
(function( $, prototype ) {
626581
$.extend( prototype.options.icons, {

0 commit comments

Comments
 (0)