Skip to content

Commit

Permalink
fix(core): support jQlite
Browse files Browse the repository at this point in the history
  • Loading branch information
SobolievOleksii authored and mportuga committed May 20, 2019
1 parent 30b26a9 commit 78e44f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/js/directives/ui-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ function uiGridDirective($window, gridUtil, uiGridConstants) {

// Resize the grid on window resize events
function gridResize() {
if (!$elm.is(':visible')) {
if (!gridUtil.isVisible($elm)) {
return;
}
grid.gridWidth = $scope.gridWidth = gridUtil.elementWidth($elm);
Expand Down
4 changes: 4 additions & 0 deletions packages/core/src/js/services/ui-grid-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,10 @@ module.service('gridUtil', ['$log', '$window', '$document', '$http', '$templateC

},

isVisible: function (elem) {
return !!( elem[0].offsetWidth || elem[0].offsetHeight || elem[0].getClientRects().length )
},

// Thanks to http://stackoverflow.com/a/13382873/888165
getScrollbarWidth: function() {
var outer = document.createElement("div");
Expand Down

0 comments on commit 78e44f9

Please sign in to comment.