]> source.dussan.org Git - jquery-ui.git/commitdiff
Controlgroup: Rename excludeInvisible to onlyVisible
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Wed, 30 Sep 2015 13:38:42 +0000 (15:38 +0200)
committerAlexander Schmitz <arschmitz@gmail.com>
Thu, 8 Oct 2015 18:02:58 +0000 (14:02 -0400)
Gets rid of the double negative.

tests/unit/controlgroup/common.js
tests/unit/controlgroup/methods.js
tests/unit/controlgroup/options.js
ui/widgets/controlgroup.js

index e072535d2f7319edeed31c1091044fc0717c9597..70fcfc3e9eeb0937026f923bc9777ddef007868d 100644 (file)
@@ -17,7 +17,7 @@ common.testWidget( "controlgroup", {
                        "controlgroupLabel": ".ui-controlgroup-label"
                },
                direction: "horizontal",
-               excludeInvisible: true,
+               onlyVisible: true,
                classes: {},
 
                // Callbacks
index b0d711ee778b5d2e99dfcd63cacc402a3653bdb4..77715f8b80cde364fc96f1cee2279e0ec69b8227 100644 (file)
@@ -83,7 +83,7 @@ $.each( tests, function( widget, html ) {
                        }
 
                        // Hide each element and check the corner classes
-                       function iterateHidden( excludeInvisible ) {
+                       function iterateHidden( onlyVisible ) {
                                for ( i = 0; i < 4; i++ ) {
 
                                        $( controls ).each( showElements );
@@ -91,7 +91,7 @@ $.each( tests, function( widget, html ) {
                                        controls[ i ][ widget ]( "widget" ).hide();
 
                                        currentClasses = classes.slice( 0 );
-                                       if ( excludeInvisible ) {
+                                       if ( onlyVisible ) {
                                                if ( i === 0 ) {
                                                        currentClasses[ i + 1 ] = classes[ i ];
                                                        currentClasses[ i ] = false;
@@ -128,7 +128,7 @@ $.each( tests, function( widget, html ) {
                        iterateHidden( true );
 
                        // Set the exclude option to false so we no longer care about hidden
-                       element.controlgroup( "option", "excludeInvisible", false );
+                       element.controlgroup( "option", "onlyVisible", false );
 
                        // Iterate hiding the elements again and check their corner classes
                        iterateHidden();
index 90a57e093b68f9350b45122a7d011c3973958075..0a1b88f1bd93d6b7e4147aa15e6c42a9cbe116fc 100644 (file)
@@ -73,21 +73,21 @@ test( "items: custom widget", function() {
                "Custom widget called" );
 } );
 
-test( "excludeInvisible", function( assert ) {
+test( "onlyVisible", function( assert ) {
        expect( 4 );
        var element = $( ".controlgroup" ).controlgroup( {
-                       excludeInvisible: false
+                       onlyVisible: false
                } ),
                buttons = element.children( ".ui-button" );
 
        assert.lacksClassStart( buttons.eq( 1 ), "ui-corner" );
        assert.hasClasses( buttons.eq( 0 ), "ui-corner-left",
-               "ExcludeInvisible: false: First button hidden second button doesn't get a corner class" );
+               "onlyVisible: false: First button hidden second button doesn't get a corner class" );
 
-       element.controlgroup( "option", "excludeInvisible", true );
+       element.controlgroup( "option", "onlyVisible", true );
        assert.lacksClassStart( buttons.eq( 0 ), "ui-corner" );
        assert.hasClasses( buttons.eq( 1 ), "ui-corner-left",
-               "ExcludeInvisible: true: First button is hidden second button get corner class" );
+               "onlyVisible: true: First button is hidden second button get corner class" );
 } );
 
 test( "direction", function( assert ) {
index 4fc348e28594cb20a6ba1ed09954ac4450d99137..5974d51c9bde360ba55ca62f4f8deceeb09459f1 100644 (file)
@@ -36,7 +36,7 @@ return $.widget( "ui.controlgroup", {
        options: {
                direction: "horizontal",
                disabled: null,
-               excludeInvisible: true,
+               onlyVisible: true,
                items: {
                        "button": "input[type=button], input[type=submit], input[type=reset], button, a",
                        "controlgroupLabel": ".ui-controlgroup-label",
@@ -209,7 +209,7 @@ return $.widget( "ui.controlgroup", {
                children = this.childWidgets;
 
                // We filter here because we need to track all childWidgets not just the visible ones
-               if ( this.options.excludeInvisible ) {
+               if ( this.options.onlyVisible ) {
                        children = children.filter( ":visible" );
                }