@@ -2069,26 +2069,23 @@ var HeaderCell = Backgrid.HeaderCell = Backbone.View.extend({
20692069 }
20702070 }
20712071 } ) ;
2072- this . listenTo ( column , "change:direction" , this . setCellDirectionMaybe ) ;
2072+ this . listenTo ( column , "change:direction" , this . setCellDirection ) ;
20732073 this . listenTo ( column , "change:name change:label" , this . render ) ;
20742074
20752075 if ( Backgrid . callByNeed ( column . editable ( ) , column , collection ) ) $el . addClass ( "editable" ) ;
20762076 if ( Backgrid . callByNeed ( column . sortable ( ) , column , collection ) ) $el . addClass ( "sortable" ) ;
20772077 if ( Backgrid . callByNeed ( column . renderable ( ) , column , collection ) ) $el . addClass ( "renderable" ) ;
20782078
2079- this . listenTo ( collection , "backgrid: sort" , this . removeCellDirectionMaybe ) ;
2079+ this . listenTo ( collection , "sort" , this . removeCellDirection ) ;
20802080 } ,
20812081
20822082 /**
2083- Event handler for the collection's `backgrid:sort` event. Removes all the
2084- CSS direction classes if the column being sorted on is not the same as this
2085- header cell's.
2083+ Event handler for the collection's `sort` event. Removes all the CSS
2084+ direction classes.
20862085 */
2087- removeCellDirectionMaybe : function ( columnToSort ) {
2088- if ( columnToSort . cid != this . column . cid ) {
2089- this . $el . removeClass ( "ascending" ) . removeClass ( "descending" ) ;
2090- this . column . set ( "direction" , null ) ;
2091- }
2086+ removeCellDirection : function ( ) {
2087+ this . $el . removeClass ( "ascending" ) . removeClass ( "descending" ) ;
2088+ this . column . set ( "direction" , null ) ;
20922089 } ,
20932090
20942091 /**
@@ -2097,9 +2094,9 @@ var HeaderCell = Backgrid.HeaderCell = Backbone.View.extend({
20972094 CSS class to the header cell. Removes all the CSS direction classes
20982095 otherwise.
20992096 */
2100- setCellDirectionMaybe : function ( columnToSort , direction ) {
2097+ setCellDirection : function ( column , direction ) {
21012098 this . $el . removeClass ( "ascending" ) . removeClass ( "descending" ) ;
2102- if ( columnToSort . cid == this . column . cid ) this . $el . addClass ( direction ) ;
2099+ if ( column . cid == this . column . cid ) this . $el . addClass ( direction ) ;
21032100 } ,
21042101
21052102 /**
0 commit comments