File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -796,7 +796,7 @@ var unbxdSearchInit = function(jQuery, Handlebars){
796
796
} else if ( this . options . sortContainerType === 'click' ) {
797
797
jQuery ( this . options . sortContainerSelector ) . on ( {
798
798
click : changeSort
799
- } , '* ' ) ;
799
+ } , '[unbxdsortfield] ' ) ;
800
800
}
801
801
}
802
802
@@ -808,7 +808,7 @@ var unbxdSearchInit = function(jQuery, Handlebars){
808
808
} else if ( this . options . pageSizeContainerType === 'click' ) {
809
809
jQuery ( this . options . pageSizeContainerSelector ) . on ( {
810
810
click : changePageSize
811
- } , '* ' ) ;
811
+ } , '[unbxdpagesize] ' ) ;
812
812
}
813
813
jQuery ( this . options . pageSizeContainerSelector ) . delegate ( '*' , 'change' , function ( e ) {
814
814
@@ -1414,7 +1414,11 @@ var unbxdSearchInit = function(jQuery, Handlebars){
1414
1414
this . compiledSortContainerTemp = Handlebars . compile ( this . options . sortContainerTemp ) ;
1415
1415
1416
1416
var sortOptions = this . options . sortOptions . map ( function ( opt ) {
1417
- opt [ 'selected' ] = ( opt . hasOwnProperty ( 'field' ) && opt . field in this . params . sort && this . params . sort [ opt . field ] === opt . order ) ? true : false ;
1417
+ if ( Object . keys ( this . params . sort ) . length > 0 ) {
1418
+ opt [ 'selected' ] = ( opt . hasOwnProperty ( 'field' ) && opt . field in this . params . sort && this . params . sort [ opt . field ] === opt . order ) ? true : false ;
1419
+ } else {
1420
+ opt [ 'selected' ] = opt [ 'selected' ] || false ;
1421
+ }
1418
1422
return opt ;
1419
1423
} . bind ( this ) ) ;
1420
1424
You can’t perform that action at this time.
0 commit comments