Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[controlgroup] Re-introduce refresh() method, to mark first and last …

…visible child
  • Loading branch information...
commit dab9bf9bd12860c184195dc7959a612fa95a0183 1 parent fab9b3f
@gabrielschulhof gabrielschulhof authored
Showing with 17 additions and 0 deletions.
  1. +17 −0 js/widgets/controlgroup.js
View
17 js/widgets/controlgroup.js
@@ -43,6 +43,8 @@ define( [ "jquery",
self.options[ key ] = undefined;
self._setOption( key, value, true );
});
+
+ this._refresh( true );
},
_setOption: function( key, value ) {
@@ -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 );
}
});
Please sign in to comment.
Something went wrong with that request. Please try again.