Skip to content

Commit 1f116fe

Browse files
Portugal, Marcelomportuga
Portugal, Marcelo
authored andcommitted
fix(ui-grid-util): Reducing amount of digests triggered by ui-grid-util.
1 parent ccd0bef commit 1f116fe

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

.travis.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ env:
3030
branches:
3131
only:
3232
- master
33-
- /^3\.0$/
34-
- /^3\.x$/
33+
- 4.0.3-release
34+
- /^4\.0$/
35+
- /^4\.x$/
3536
- /^release-.*$/
3637

3738
before_install:

src/js/core/services/ui-grid-util.js

+5-8
Original file line numberDiff line numberDiff line change
@@ -619,10 +619,7 @@ module.service('gridUtil', ['$log', '$window', '$document', '$http', '$templateC
619619
},
620620

621621
isNullOrUndefined: function(obj) {
622-
if (obj === undefined || obj === null) {
623-
return true;
624-
}
625-
return false;
622+
return (obj === undefined || obj === null);
626623
},
627624

628625
endsWith: function(str, suffix) {
@@ -831,7 +828,7 @@ module.service('gridUtil', ['$log', '$window', '$document', '$http', '$templateC
831828
} else {
832829
s.logWarn('[focus.byId] Element id ' + elementID + ' was not found.');
833830
}
834-
});
831+
}, 0, false);
835832
this.queue.push(promise);
836833
return promise;
837834
},
@@ -856,7 +853,7 @@ module.service('gridUtil', ['$log', '$window', '$document', '$http', '$templateC
856853
if (element){
857854
element[0].focus();
858855
}
859-
});
856+
}, 0, false);
860857
this.queue.push(promise);
861858
return promise;
862859
},
@@ -886,8 +883,8 @@ module.service('gridUtil', ['$log', '$window', '$document', '$http', '$templateC
886883
};
887884
this._purgeQueue();
888885
if (aSync){ //Do this asynchronysly
889-
var promise = $timeout(focusBySelector);
890-
this.queue.push($timeout(focusBySelector));
886+
var promise = $timeout(focusBySelector, 0, false);
887+
this.queue.push(promise);
891888
return promise;
892889
} else {
893890
return focusBySelector();

0 commit comments

Comments
 (0)