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

Commit

Permalink
[controlgroup] Re-introduce refresh() method, to mark first and last …
Browse files Browse the repository at this point in the history
…visible child
  • Loading branch information
Gabriel Schulhof committed Nov 8, 2012
1 parent fab9b3f commit dab9bf9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions js/widgets/controlgroup.js
Expand Up @@ -43,6 +43,8 @@ define( [ "jquery",
self.options[ key ] = undefined;
self._setOption( key, value, true );
});

this._refresh( true );
},

_setOption: function( key, value ) {
Expand Down Expand Up @@ -76,6 +78,21 @@ define( [ "jquery",

container: function() {
return this.element.children( ".ui-controlgroup-controls" );
},

_refresh: function( create ) {
var els = this.element.find( ".ui-btn" ).not( ".ui-slider-handle" );

els.removeClass( "ui-first-child ui-last-child" );
if ( !create && this.options.excludeInvisible ) {
els = els.filter( ":visible" );
}

els.eq( 0 ).addClass( "ui-first-child" ).end().last().addClass( "ui-last-child" );
},

refresh: function() {
this._refresh( false );
}
});

Expand Down

0 comments on commit dab9bf9

Please sign in to comment.