Skip to content

Commit 6fc2cb3

Browse files
jzaeffererarschmitz
authored andcommitted
Controlgroup: Rename excludeInvisible to onlyVisible
Gets rid of the double negative.
1 parent 42daa77 commit 6fc2cb3

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

tests/unit/controlgroup/common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ common.testWidget( "controlgroup", {
1717
"controlgroupLabel": ".ui-controlgroup-label"
1818
},
1919
direction: "horizontal",
20-
excludeInvisible: true,
20+
onlyVisible: true,
2121
classes: {},
2222

2323
// Callbacks

tests/unit/controlgroup/methods.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,15 @@ $.each( tests, function( widget, html ) {
8383
}
8484

8585
// Hide each element and check the corner classes
86-
function iterateHidden( excludeInvisible ) {
86+
function iterateHidden( onlyVisible ) {
8787
for ( i = 0; i < 4; i++ ) {
8888

8989
$( controls ).each( showElements );
9090

9191
controls[ i ][ widget ]( "widget" ).hide();
9292

9393
currentClasses = classes.slice( 0 );
94-
if ( excludeInvisible ) {
94+
if ( onlyVisible ) {
9595
if ( i === 0 ) {
9696
currentClasses[ i + 1 ] = classes[ i ];
9797
currentClasses[ i ] = false;
@@ -128,7 +128,7 @@ $.each( tests, function( widget, html ) {
128128
iterateHidden( true );
129129

130130
// Set the exclude option to false so we no longer care about hidden
131-
element.controlgroup( "option", "excludeInvisible", false );
131+
element.controlgroup( "option", "onlyVisible", false );
132132

133133
// Iterate hiding the elements again and check their corner classes
134134
iterateHidden();

tests/unit/controlgroup/options.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,21 +73,21 @@ test( "items: custom widget", function() {
7373
"Custom widget called" );
7474
} );
7575

76-
test( "excludeInvisible", function( assert ) {
76+
test( "onlyVisible", function( assert ) {
7777
expect( 4 );
7878
var element = $( ".controlgroup" ).controlgroup( {
79-
excludeInvisible: false
79+
onlyVisible: false
8080
} ),
8181
buttons = element.children( ".ui-button" );
8282

8383
assert.lacksClassStart( buttons.eq( 1 ), "ui-corner" );
8484
assert.hasClasses( buttons.eq( 0 ), "ui-corner-left",
85-
"ExcludeInvisible: false: First button hidden second button doesn't get a corner class" );
85+
"onlyVisible: false: First button hidden second button doesn't get a corner class" );
8686

87-
element.controlgroup( "option", "excludeInvisible", true );
87+
element.controlgroup( "option", "onlyVisible", true );
8888
assert.lacksClassStart( buttons.eq( 0 ), "ui-corner" );
8989
assert.hasClasses( buttons.eq( 1 ), "ui-corner-left",
90-
"ExcludeInvisible: true: First button is hidden second button get corner class" );
90+
"onlyVisible: true: First button is hidden second button get corner class" );
9191
} );
9292

9393
test( "direction", function( assert ) {

ui/widgets/controlgroup.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ return $.widget( "ui.controlgroup", {
3636
options: {
3737
direction: "horizontal",
3838
disabled: null,
39-
excludeInvisible: true,
39+
onlyVisible: true,
4040
items: {
4141
"button": "input[type=button], input[type=submit], input[type=reset], button, a",
4242
"controlgroupLabel": ".ui-controlgroup-label",
@@ -209,7 +209,7 @@ return $.widget( "ui.controlgroup", {
209209
children = this.childWidgets;
210210

211211
// We filter here because we need to track all childWidgets not just the visible ones
212-
if ( this.options.excludeInvisible ) {
212+
if ( this.options.onlyVisible ) {
213213
children = children.filter( ":visible" );
214214
}
215215

0 commit comments

Comments
 (0)