Skip to content

Commit

Permalink
fix(ui-grid-util): Reducing amount of digests triggered by ui-grid-util.
Browse files Browse the repository at this point in the history
  • Loading branch information
Portugal, Marcelo authored and mportuga committed Mar 24, 2017
1 parent ccd0bef commit 1f116fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ env:
branches:
only:
- master
- /^3\.0$/
- /^3\.x$/
- 4.0.3-release
- /^4\.0$/
- /^4\.x$/
- /^release-.*$/

before_install:
Expand Down
13 changes: 5 additions & 8 deletions src/js/core/services/ui-grid-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -619,10 +619,7 @@ module.service('gridUtil', ['$log', '$window', '$document', '$http', '$templateC
},

isNullOrUndefined: function(obj) {
if (obj === undefined || obj === null) {
return true;
}
return false;
return (obj === undefined || obj === null);
},

endsWith: function(str, suffix) {
Expand Down Expand Up @@ -831,7 +828,7 @@ module.service('gridUtil', ['$log', '$window', '$document', '$http', '$templateC
} else {
s.logWarn('[focus.byId] Element id ' + elementID + ' was not found.');
}
});
}, 0, false);
this.queue.push(promise);
return promise;
},
Expand All @@ -856,7 +853,7 @@ module.service('gridUtil', ['$log', '$window', '$document', '$http', '$templateC
if (element){
element[0].focus();
}
});
}, 0, false);
this.queue.push(promise);
return promise;
},
Expand Down Expand Up @@ -886,8 +883,8 @@ module.service('gridUtil', ['$log', '$window', '$document', '$http', '$templateC
};
this._purgeQueue();
if (aSync){ //Do this asynchronysly
var promise = $timeout(focusBySelector);
this.queue.push($timeout(focusBySelector));
var promise = $timeout(focusBySelector, 0, false);
this.queue.push(promise);
return promise;
} else {
return focusBySelector();
Expand Down

0 comments on commit 1f116fe

Please sign in to comment.