Skip to content

Commit

Permalink
Fix #379
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzofox3 committed May 11, 2015
1 parent 7d18cd8 commit f9b042f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/stConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ ng.module('smart-table')
},
sort: {
ascentClass: 'st-sort-ascent',
descentClass: 'st-sort-descent'
descentClass: 'st-sort-descent',
skipNatural: false
},
pipe: {
delay: 100 //ms
Expand Down
3 changes: 2 additions & 1 deletion src/stSort.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ng.module('smart-table')
var classDescent = attr.stClassDescent || stConfig.sort.descentClass;
var stateClasses = [classAscent, classDescent];
var sortDefault;
var skipNatural = attr.stSkipNatural !== undefined ? attr.stSkipNatural : stConfig.skipNatural;

if (attr.stSortDefault) {
sortDefault = scope.$eval(attr.stSortDefault) !== undefined ? scope.$eval(attr.stSortDefault) : attr.stSortDefault;
Expand All @@ -21,7 +22,7 @@ ng.module('smart-table')
function sort () {
index++;
predicate = ng.isFunction(getter(scope)) ? getter(scope) : attr.stSort;
if (index % 3 === 0 && attr.stSkipNatural === undefined) {
if (index % 3 === 0 && !!skipNatural !== true) {
//manual reset
index = 0;
ctrl.tableState().sort = {};
Expand Down

0 comments on commit f9b042f

Please sign in to comment.